After the partition of India and a rebellion in the western districts of the state, Pakistani tribal militias invaded Kashmir, leading the Hindu ruler of Jammu and Kashmir to join India. The resulting Indo-Pakistani War ended with a UN-mediated ceasefire along a line that was eventually named the Line of Control.