The state was created in 1846 after the defeat of the Sikhs. The East India Company annexed the Kashmir valley and wanted to recover some of the cost of the Anglo-Sikh war. The Muslim majority Kashmir was sold to the Dogra ruler of Jammu under the Treaty of Amritsar. The area of the state were set by the Treaty of Amritsar of 1846 "situated to the eastward of the Indus and westward of the Ravi River it covered an area of 80,900 km2.