How do we know where we are, and how do we remember the places we visited? Since the discovery of place cells in 1971, our understanding of the brain's maps of external space has exploded. Yet the origin of the place-cell signal remained elusive. The discovery of grid cells in the medial entorhinal cortex (MEC) in 2005 put place cells in a context, since the existence of grid cells pointed to circuit mechanisms that might explain the formation of place cells. In this review, I shall review recent experimental and theoretical advances in the understanding of how space is mapped in the medial entorhinal cortex. I will also review recent studies of interactions between hippocampus and the lateral entorhinal cortex (LEC). Research on spatial mapping in the hippocampal-entorhinal system provides a fundament for future attempts to decipher some of the neural-circuit codes of the cortex.