The first Indo-Pakistani war started after armed tribesmen from Pakistan's north-west frontier province invaded Kashmir in October 1947. Besieged both by a revolt in his state and by the invasion, the Maharaja requested armed assistance from the government of India. In return he acceded to India, handing over powers of defence, communication and foreign affairs.
Both India and Pakistan agreed that the accession would be confirmed by a referendum once hostilities had ceased.
Historians continue to debate the precise timing when the Maharaja of Jammu and Kashmir signed the instrument of accession and the Indian army moved into the state, arguing that the Maharaja acceded to India under duress.
In May 1948, the regular Pakistani army was called upon to protect Pakistan's borders. Fighting continued throughout the year between Pakistani irregular troops and the Indian army.
The war ended on 1 January 1949 when a ceasefire was arranged by the United Nations, which recommended that both India and Pakistan should adhere to their commitment to hold a referendum in the state. A ceasefire line was established where the two sides stopped fighting and a UN peacekeeping force established. The referendum, however, has never been held.
In 1954 Jammu and Kashmir's accession to India was ratified by the state's constituent assembly. In 1957, it approved its own constitution, modelled along the Indian constitution. Since that time India has regarded that part of the state which it controls as an integral part of the Indian union.
To the west of the ceasefire line, Pakistan controls roughly one third of the state. A small region, which the Pakistanis call Azad (Free) Jammu and Kashmir, and the Indians call Pakistani-occupied Kashmir, is semi-autonomous. The larger area, which includes the former kingdoms of Hunza and Nagar, called the northern areas, is directly administered by Pakistan.
In 1962-3, following the 1962 Sino-Indian war, India and Pakistan held talks under the auspices of Britain and the US in an attempt to resolve their differences over Kashmir, but without success.