A special class of hippocampal neurons broadly known as the spatial cells, whose subcategories include place cells, grid cells and head direction cells, are considered to be the building blocks of the brain’s map of the spatial world. We present a general, deep learning-based modeling framework that describes the emergence of the spatial cell responses and can also explain behavioral responses that involve a combination of path integration and vision. The first layer of the model consists of Head Direction (HD) cells that code for preferred direction of the agent. The second layer is the path integration (PI) layer with oscillatory neurons: displacement of the agent in a given direction modulates the frequency of these oscillators. Principal Component Analysis (PCA) of the PI cell responses showed emergence of cells with grid-like spatial periodicity. We show that the response of these cells could be described by Bessel functions. The output of PI layer is used to train stack of autoencoders. Neurons of both the layers exhibit responses resembling grid cells and place cells. The paper concludes by suggesting a wider applicability of the proposed modeling framework beyond the two simulated behavioral studies.