The Red Fort was built by Mughal Emperor Shah Jahan between 1638 and 1648 when he shifted his capital from Agra to Delhi. It served as the main residence of the Mughal emperors for nearly 200 years. Akbar built Fatehpur Sikri and Agra Fort, while Qutab-ud-din and Babur preceded Shah Jahan's reign.