Agra Fort was built by the Mughal Emperor Akbar between 1565 and 1573. It served as the main residence of the Mughal emperors until Shah Jahan moved the capital to Delhi and built the Red Fort. Jehangir and Humayun were Akbar's predecessor and successor respectively, while Shah Jahan built the Red Fort, not Agra Fort.