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. After further fighting in the wars of 1965 and 1971, the Simla Agreement formally established the Line of Control between the two nations' controlled territories. In 1999, an armed conflict between India and Pakistan broke out again in Kargil with no effect on the "status quo".