The Gilgit Agency, created in 1877 and was overseen by a political agent of the Governor-General of British India, was a political unit of India, which managed the relations of the British with the princely states of Hunza and Nagar. In 1935, the Gilgit Agency leased the the northern half of the Princely state of Jammu and Kashmir from the Maharaja of Jammu and Kashmir, Hari Singh, for a period of sixty years, and administered it.
The seat of the Agent was at Srinagar. The British lease of territory and the Gilgit Agency were abandoned by the British when Pakistan and India became independent countries in 1947. However, following the Partition of India in 1947 and the First Kashmir War, the name "Gilgit Agency" was adopted by Pakistan to refer to the Northern part of Kashmir, but the name ceased to be used when the area was merged into the Northern Areas of Pakistan in 1970. Within Pakistan, the later "Gilgit Agency" was supervised directly from Islamabad, separately from the neighbouring state of Azad Kashmir and the princely states of Hunza and Nagar. It also did not include the district of Kargil and the subdivision of Ladakh which had been a part of the British Gilgit Agency. The Pakistani Agency bordered the Sinkiang region of China to the northeast, the Indian state of Jammu and Kashmir to the south, Baltistan to east, and the North-West Frontier Province to the west.
Prior to establishment of Princely state of Jammu and Kashmir by the Dogra rulers in the mid - nineteenth century, the Gilgit region had been ruled by princes who were styled Raas. The rulers of the neighboring Baltistan region used the Tibetan title of rGyal-po, having been founded as a western Tibetan kingdom in the thirteenth century. Gilgit and Baltistan, together with their neighbours Hunza, Nagar and Ladakh, became vassals of the Princely state of Jammu and Kashmir, but maintained considerable autonomy. After formation of the Gilgit Agency by the British in 1877, these territories, including the Wazarats of Gilgit and Ladakh, were administered directly by the British, though the Princely state of Jammu and Kashmir retained sovereignty.
The local rulers of these territories continued to appear at the Jammu and Kashmir Durbars until 1947. The events of Partition and the subsequent invasion of Jammu and Kashmir by Pakistani tribals during the First Kashmir War led to most of the former Gilgit Wazarat becoming part of Pakistan-administered Kashmir, but most of the Ladakh Wazarat, including the Kargil area became part of Indian-administered Kashmir. The Line of Control established at the end of the war is the current de facto border of India and Pakistan.
Initially, the Gilgit Agency was not absorbed into any of the provinces of West Pakistan, but was ruled directly by political agents of the federal government of Pakistan. In 1963, Pakistan entered into a treaty with China to transfer part of the Gilgit Agency to China, (the Trans-Karakoram Tract), with the proviso that the settlement was subject to the final solution of the Kashmir dispute.
The dissolution of the province of West Pakistan in 1970 was accompanied by change of the name of the Gilgit Agency to the Northern Areas. In 1974, the states of Hunza and Nagar and the independent valleys of Darel-Tangir, which had been de facto dependencies of Pakistan, were also incorporated into the Northern Areas.
Pakistan and India continue to dispute the sovereignty of the territories that had comprised the Gilgit Agency.