Historical aspect (Constitution of Jammu and Kashmir)
India gained its independence from the United Kingdom on midnight of 15 August 1947 IST, and simultaneously Pakistan was created as a new country as a result of the partition of India. Jammu and Kashmir, then a princely state under suzerainty of British Monarch, and ruled by the Maharaja Hari Singh tried to avoid declaring his state’s accession to either of the two dominions at the time of independence (although that was not an option under the Indian Independence Act, 1947). A Muslim majority state ruled by Hindu Maharaja Hari Singh (then the ruler of the state), government of the state signed a standstill agreement with Pakistan. However, on 6 October 1947, Pakistani Muslim tribes, supported by the government of Pakistan, attacked Jammu and Kashmir on the behest of Pakistan to achieve forcible accession to Pakistan. Maharaja Hari Singh requested assistance from India, and when India requested an Instrument of Accession to India, Maharaja signed it so that India could help in defense.
The Instrument of Accession (IoA) gave only limited powers to the Government of India, only about the three subject matters of Foreign affairs, Defence and Communications. It was similar to several hundred others IoA signed between the Government of India and other princely states. Whereas the other states later signed merger agreements, the relationship of Jammu and Kashmir with the Union of India was governed by special circumstances. In view of them, the Article 370 was incorporated in the Constitution. The Constitution of Jammu and Kashmir, which Maharaja (later Sadr-e-Riyasat) Dr. Karan Singh signed into law in 1957, is still in force.