<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> <P> In December 2001, the Parliament of India building in New Delhi was attacked by armed militants, killing six security personnel . India suspected Pakistan - based militant groups were behind the attack, which caused a major diplomatic crisis between the two countries . There were further terrorist attacks in Delhi in October 2005 and September 2008, resulting in a total of 103 deaths . </P>

When was delhi designated the national capital territory