Mortuary temples (or funerary temples) were temples that were erected adjacent to, or in the vicinity of, royal tombs in Ancient Egypt. The temples were designed to commemorate the reign of the Pharaoh by whom they were constructed, as well as for use by the Pharaoh's cult after death.
Mortuary temples were built around pyramids in the Old Kingdom and Middle Kingdom. However, once the New Kingdom pharaohs began constructing tombs in the Valley of the Kings, they built their mortuary temples separately. These New Kingdom temples were called "mansions of millions of years" by the Egyptians.
These temples were also used as a resting place for the boat of Amun at the time of the Beautiful Festival of the Valley, during which the cult statue of the god visited the west bank of Thebes.
The first mortuary temple was built for Amenhotep I of the 18th dynasty during the New Kingdom. Several other rulers of the dynasty built temples for the same purpose, the best known being those at Deir el-Bahari, where Hatshepsut built beside the funerary temple of Mentuhotep II, and that of Amenhotep III, of which the only major extant remains are the Colossi of Memnon.
Later rulers of the 18th Dynasty either failed to build here at all or, in the case of Tutankhamun, Ay and Horemheb, their construction was not completed. The 19th Dynasty ruler Seti I constructed his temple at what is now known as Gurna. Part of his "Glorious temple of Seti Merenptah in the field of Amun which resides at the West of Thebes" was dedicated to his father Ramesses I, whose short reign prevented him from building his own, and was completed by his son Ramesses II.