Kashmir was neither as large nor as old an independent state as Hyderabad; it had been created rather off-handedly by the British after the first defeat of the Sikhs in 1846, as a reward to a former official who had sided with the British. The Himalayan kingdom was connected to India through a district of the Punjab, but its population was 77 per cent Muslim and it shared a boundary with Pakistan. Hence, it was anticipated that the maharaja would accede to Pakistan when the British paramountcy ended on 1415 August. When he hesitated to do this, Pakistan launched a guerrilla onslaught meant to frighten its ruler into submission. Instead the Maharaja appealed to Mountbatten[35] for assistance, and the governor-general agreed on the condition that the ruler accede to India. Indian soldiers entered Kashmir and drove the Pakistani-sponsored irregulars from all but a small section of the state. The United Nations was then invited to mediate the quarrel. The UN mission insisted that the opinion of Kashmiris must be ascertained, while India insisted that no referendum could occur until all of the state had been cleared of irregulars.