<P> After the death of Aurangzeb in 1707, the Mughal Empire's influence declined rapidly as the Hindu Maratha Empire from Deccan Plateau rose to prominence . In 1737, Maratha forces sacked Delhi following their victory against the Mughals in the First Battle of Delhi . In 1739, the Mughal Empire lost the huge Battle of Karnal in less than three hours against the numerically outnumbered but militarily superior Persian army led by Nader Shah of Persia . After his invasion, he completely sacked and looted Delhi, carrying away immense wealth including the Peacock Throne, the Daria - i - Noor, and Koh - i - Noor . The Mughals, severely further weakened, could never overcome this crushing defeat and humiliation which also left the way open for more invaders to come, including eventually the British . Nader eventually agreed to leave the city and India after forcing the Mughal emperor Muhammad Shah I to beg him for mercy and granting him the keys of the city and the royal treasury . A treaty signed in 1752 made Marathas the protectors of the Mughal throne in Delhi . </P> <P> In 1757, the Afghan ruler, Ahmad Shah Durrani, sacked Delhi . He returned to Afghanistan leaving a Mughal puppet ruler in nominal control . The Marathas again occupied Delhi in 1758, and were in control until their defeat in 1761 at the third battle of Panipat when the city was captured again by Ahmad Shah . However, in 1771, the Marathas established a protectorate over Delhi when the Maratha ruler, Mahadji Shinde, recaptured Delhi and the Mughal Emperor Shah Alam II was installed as a puppet ruler in 1772 . In 1783, Sikhs under Baghel Singh captured Delhi and Red Fort but due to the treaty signed, Sikhs withdrew from Red Fort and agreed to restore Shah Alam II as the emperor . In 1803, during the Second Anglo - Maratha War, the forces of British East India Company defeated the Maratha forces in the Battle of Delhi . </P> <P> During the Indian Rebellion of 1857, Delhi fell to the forces of East India Company after a bloody fight known as the Siege of Delhi . The city came under the direct control of the British Government in 1858 . It was made a district province of the Punjab . In 1911, it was announced that the capital of British held territories in India was to be transferred from Calcutta to Delhi . The name "New Delhi" was given in 1927, and the new capital was inaugurated on 13 February 1931 . New Delhi, also known as Lutyens' Delhi, was officially declared as the capital of the Union of India after the country gained independence on 15 August 1947 . During the partition of India, thousands of Hindu and Sikh refugees, mainly from West Punjab fled to Delhi, while many Muslim residents of the city migrated to Pakistan . Migration to Delhi from the rest of India continues (as of 2013), contributing more to the rise of Delhi's population than the birth rate, which is declining . </P> <P> The States Reorganisation Act, 1956 and the States Reorganisation Act, 1956 created the Union Territory of Delhi from the its predecessor the Chief Commissioner's Province of Delhi . The Constitution (Sixty - ninth Amendment) Act, 1991 declared the Union Territory of Delhi to be formally known as the National Capital Territory of Delhi . The Act gave Delhi its own legislative assembly along Civil lines, though with limited powers . </P>

Which year delhi became the capital of india