It served as the capital of the Mughals until 1857, when Mughal emperor Bahadur Shah Zafar was exiled by the British Indian government. The fort lies along the Yamuna River, which fed the moats that surround most of the walls.  The wall at its north-eastern corner is adjacent to an older fort, the Salimgarh Fort, a defence built by Islam Shah Suri in 1546. The construction of the Red Fort began in 1638 and was completed by 1648. The Red Fort has had many developments added on after its construction by Emperor Shah Jahan.
The significant phases of development were under Aurangzeb and later under later Mughal rulers. It was designated a UNESCO World Heritage Site in 2007.  The earlier Red Fort was built by Tomara king Anangpala, now known as the Qulb Mosque.  The Red Fort derives its name from the extensive use of red sandstone on the massive walls that surround the fort.  Shah Jahan commissioned the construction of the Red Fort in 1638 when he decided to shift his capital from Agra to Delhi. Ustad Ahmad was chosen as the architect for construction of the royal palace.
Construction began in the auspicious month of Muharram on 13 May 1638. :01 Construction of the fort was supervised by Shah Jahan himself and was completed in 1648.  The Red Fort was originally referred to as Qila-i-Mubarak (the blessed fort), because it was the residence of the royal family.  Unlike the other Mughal forts, layout of the boundary walls of the Red Fort is not symmetrical so as to retain and integrate the older Salimgarh Fort. :04 The fortress palace was an important focal point of the medieval city of Shahjahanabad (present day Old Delhi).
The planning and aesthetics of the Red Fort represent the zenith of Mughal creativity which prevailed during the reign of emperor Shah Jahan. Aurangzeb, Shah Jahans successor, added the Moti Masjid to the emperors private quarters and constructed barbicans in front of the two main gates, which made the entrance route to the palace more circuitous. :08 The administrative and fiscal structure of the Mughals declined after Aurangzeb. The 18th century thus saw a degeneration of the palace and inhabitants of the Red Fort.
When Jahandar Shah took over the Red Fort in 1712, the palace had been without an emperor for 30 years. Within a year of his rule, Jahandar Shah was murdered and replaced by Farukhsiyar. To combat the declining finances, the silver ceiling of the palace Rang Mahal was replaced by copper during this period. Muhammad Shah, who was also known as Rangila (the colourful) for his deep interest in arts, took over the Red Fort in 1719. In 1739, Nadir Shah, the Persian emperor, attacked the Mughals. The Mughal army was easily defeated and Nadir Shah plundered the Red Fort of its riches including the Peacock Throne.
Nadir Shah returned to Persia after three months leaving a destroyed city and a weakening Mughal empire to Muhammad Shah. :09 The internal weaknesses of the Mughal empire turned Mughals into titular heads of Delhi. A treaty signed in 1752 made Marathas the protector of the throne at Delhi.  The Maratha conquest of Lahore and Peshawar in 1758, put them in direct confrontation with Ahmad Shah Durrani.  In 1760, the Marathas removed and melted the Silver ceiling of the Diwan-i-Khas to generate funds for the defence of Delhi from the armies of Ahmed Shah Durrani.
 In 1761, after the Marathas lost the third battle of Panipat, Delhi was raided by Ahmed Shah Durrani. In 1771, Shah Alam ascended to the throne in Delhi with the support of the Marathas. :10 In 1783, the Sikh Misl Karorisinghia, led by Baghel Singh Dhaliwal, conquered Delhi and the Red Fort. Sikhs agreed to restore Shah Alam as the emperor and retreat from the fort on the condition that Mughals would construct and protect seven historical Gurudwaras in Delhi associated with the Sikh gurus. 
Red Fort Before the Seige The Illustrated London News 1858 In 1803, during the Second Anglo-Maratha War, the forces of British East India Company defeated the Maratha forces in the Battle of Delhi, ending the Maratha rule over the city and their control over the fort.  After the battle, British took over the administration of Mughal territories and installed a Resident at the Mughal courts in Red Fort. :11 The last Mughal emperor to occupy the fort, Bahadur Shah II Zafar, emerged as a symbol of the 1857 rebellion against the British in which the residents of Shahjahanbad participated.
:15 Red Fort in Delhi, c. 1905 Despite being the seat of Mughal power and its defensive capabilities, the Red Fort was not defended during the 1857 uprising against the British. After the failure of the rebellion, Bahadur Shah II left the fort on 17 September and was apprehended by British forces. He returned to Red Fort as a prisoner of the British and was tried in 1858. He was exiled to Rangoon on 7 October of the same year.  With the end of the Mughal reign, the British gave official sanctions to remove and sell valuables from the palace at the Red Fort.
In 1863, British destroyed many buildings inside and outside the fort, filled up the gardens, stripped the fort of any valuable items and reduced it to just a military structure. :167 After Indian Independence, the site experienced few changes in terms of addition or alteration to the structures. The Red Fort continued to be used as a cantonment even after Independence. A significant part of the fort remained under the control of the Indian Army until 22 December 2003, when it was handed over to the Archaeological Survey of India for restoration.  Architectural designs
The Red Fort covers a total area of about 254. 67 acres enclosed within 2. 4 kilometres of defence walls.  The walls are punctuated by turrets and bastions. They vary in height from 18 m on the river side to 33 m on the city side. The fort is shaped like an octagon with the north-south axis longer than the east-west axis. The use of marble, floral decorations, double domes in the buildings inside the fort exemplifies the later phase of Mughal architecture.  It showcases a very high level of art form and ornamental work. It is believed that the Kohinoor diamond was a part of the furniture.
The art work in the Fort is a synthesis of Persian, European and Indian art which resulted in the development of unique Shahjahani style which is very rich in form, expression and colour. Red Fort is one of the important building complexes of India which encapsulates a long period of Indian history and its arts. Even before its notification as a monument of national importance in the year 1913, efforts were made to preserve and conserve the Red Fort, for posterity. The walls of Lahore and Delhi gates were for the general public and Khizrabad Gate was for emperors personal use.
:04 The Lahore Gate is the main entrance leading to the domed arcade containing shops called the Chatta Chowk (covered bazaar).  Silk, jewellery and other items which catered to the royal household were sold in Chatta Chowk in the Mughal period. Chatta Chowk leads to a large open space where it crosses the large north-south street that was originally the division between the forts military functions, to its west, and the palaces, to its east. The southern end of this street is the Delhi Gate. Important structures Lahore Gate The Indian flag flying from Lahore Gate
The Lahore gate is the main gate to the Red Fort named after its orientation towards Lahore, Pakistan. It is said that during Aurangzebs reign the beauty of both the gates was spoiled by adding bastions: The vista like a veil drawn across the face of a beautiful woman.  Every year since Indian Independence Day 1947, the national flag has been raised and the Prime Minister has made a speech from the ramparts at the Lahore Gate. In the 1980s, the security of the area was increased by blocking the tower windows as a security measure against sniper attacks. A lift was also added to the gate.  Delhi Gate