Humans generate complex hierarchies across a variety of domains, including language and music, and this capacity is often associated with activity in inferior frontal gyrus (IFG). Non-human animals have also been shown to represent simple hierarchies in spatial navigation, and human neuroimaging work has implicated the hippocampus in the encoding of items-in-contexts representations, which constitute 2-level hierarchical dependencies. These fields of research use distinct paradigms, leading to disjoint models and precluding adequate cross-species comparisons. In this study, we developed a paradigm to bring together these two areas of research and show that anterior hippocampus and medial prefrontal cortex encode hierarchical context, mimicking findings from animal spatial navigation. Additionally, we replicated classic neurolinguistic findings of 1) left IFG and posterior temporal cortex in the representation of hierarchies and 2) the association between IFG and processing automaticity. We propose that mammals share an evolutionary ancient system for the generation of simple hierarchies which is complemented in humans by additional capacities.