Yes, Kashmir was a princely state under the name Princely State of Kashmir and Jammu. It was created in the aftermath of the First Anglo-Sikh War, from the territories that had earlier been in Sikh Empire.
Kashmir was a focal point of the first Indo-Pak war of 1948. The dispute over its ultimate fate – Whether it should join India or Pakistan or remain an independent entity – has been a root cause of animosity between India and Pakistan ever since.
For further reading check the following articles: