Kashmir is the northwestern region of the Indian subcontinent. Until the mid-19th century, the term "Kashmir" referred only to the valley lying between the Great Himalayas and the Pir Panjal range; since then, it has been used for a larger area that today includes the Indian-administered state of Jammu and Kashmir consisting of the Kashmir valley, Jammu and Ladakh; the Pakistani-administered provinces of the Northern Areas and Azad Kashmir, and the Chinese-administered region of Aksai Chin.
In the first half of the first millennium, Kashmir became an important center of Hinduism and later of Buddhism; later still, in the ninth century, Kashmir Shaivism arose in the region. In 1349, Shah Mirza became the first Muslim ruler of Kashmir and inaugurated the line Salatin-i-Kashmir. For the next five centuries Kashmir had Muslim monarchs, including the Mughals, who ruled until 1751, and thereafter, the Afghan Durranis, who ruled until 1820.That year, the Sikhs under Ranjit Singh, annexed Kashmir. In 1846, upon the purchase of the region from the British under the Treaty of Amritsar, the Dogras—under Gulab Singh—became the new rulers. Dogra Rule, under the paramountcy of the British Crown, lasted until 1947, when the former princely state became a disputed territory, now administered by three countries: India, Pakistan, and the People's Republic of China.