The Taj Mahal is a tomb built in the 17th century by Moghul ruler Shah Jahan in memory of his wife , Mumtaz Mahal . It was built by Mughal emperor Shah Jahan in memory of his third wife , Mumtaz Mahal .