When the British relinquished their claims to paramountcy, the 562 independent princely states were given the option to join either of the two nations. A few princely states readily joined Pakistan, but the rest--except Hyderabad (the largest of the princely states with 132,000 square kilometers and a population of more than 14 million), Jammu and Kashmir (with 3 million inhabitants), and Junagadh (with a population of 545,000)--merged with India... The Hindu maharajah of predominantly Muslim Jammu and Kashmir remained uncommitted until armed tribesmen and regular troops from Pakistan infiltrated his domain, inducing him to sign the Instrument of Accession to India on October 27, 1947. Pakistan refused to accept the legality of the accession, and, as a result, war broke out...
The first test for the Indian armed forces came shortly after independence with the first Indo-Pakistani conflict (1947-48). The military was called upon to defend the borders of the state of Jammu and Kashmir when tribals--principally Pathans--attacked from the northwest reaches of Kashmir on October 22, 1947. India's 161st Infantry Brigade was deployed and thwarted the advance of the tribal forces. In early November 1947, the 161st counterattacked and successfully broke through the enemy defenses. Despite early successes, the Indian army suffered a setback in December because of logistical problems. The problems enabled the forces of Azad Kashmir (Free Kashmir, as the part of Kashmir under Pakistani control is called) to take the initiative and force the Indian troops to retreat from the border areas. In the spring of 1948, the Indian side mounted another offensive to retake some of the ground that it had lost. No doubt fearing that the war might move into Pakistan proper, regular units of the Pakistani army became more actively involved. As the conflict escalated, the Indian leadership was quick to recognize that the war could not be brought to a close unless Pakistani support for the Azad Kashmir forces could be stopped. Accordingly, on the advice of Governor General Earl Louis Mountbatten (Britain's last viceroy in India in 1947 and governor general of India, 1947-48), the Indian government sought United Nations (UN) mediation of the conflict on December 31, 1947. There was some opposition to this move within the cabinet by those who did not agree with referring the Kashmir dispute to the UN. The UN mediation process brought the war to a close on January 1, 1949. In all, 1,500 soldiers died on each side during the war.
The maharaja of Jammu and Kashmir, unpopular among his subjects, was reluctant to decide on accession to either dominion. He first signed agreements with both Pakistan and India that would provide for the continued flow of people and goods to Kashmir--as it is usually called--from both dominions. Alarmed by reports of oppression of fellow Muslims in Kashmir, armed groups from the North-West Frontier Province entered the maharaja's territory. The ruler requested military assistance from India but had to sign documents acceding to India before that country would provide aid in October 1947.
The government of Pakistan refused to recognize the accession and denounced it as a fraud even though the Indian government announced that it would require an expression of the people's will through a plebiscite after the invaders were driven back. Pakistan launched an active military and diplomatic campaign to undo the accession. The UN Security Council eventually brought about a cease-fire between Pakistani and Indian troops, which took place on January 1, 1949, thus ending the first Indo- Pakistani War, and directed that a plebiscite be held. The cease- fire agreement formalized the military status quo, leaving about 30 percent of Kashmir under Pakistani control.