The history of the Kashmir valley has been turbulent. In the 3rd century bc, it was a part of the great Mauryan Empire. Later on, this region flourished under the rule of the Kushans in the 1st century ad. It was an important Buddhist center around this time. In the 6th century, it was a part of the kingdom of Vikramaditya, the ruler of Ujjain. Local Hindu rulers ruled it until the 14th century, after which Muslims invaded and ruled it.
Srinagar was a part of the Mughal Empire in the medieval period. However, with the decline of the Mughal Empire and the rule of the Pathans, the fortunes of the area gradually dwindled. In 1814, it became a part of the Sikh empire, when Ranjit Singh defeated the Pathans. However, the British defeated Ranjit Singh and according to the treaty of Lahore in 1846, they installed Gulab Singh as the independent ruler of Kashmir. The descendents of Gulab Singh ruled Kashmir under the vigilance of the British till 1947. Hari Singh, the great grandson of Gulab Singh, merged this princely state into India in 1948, when Pathan marauders from Pakistan tried to overrun this state.