Musharraf was born in Delhi, but his family moved to Pakistan after the partition of India (1947). Joining the army in 1964, he rose to become army chief of staff in 1998. In 1999 he ousted the Prime Minister, Narwaz Sharif, in a bloodless coup following a dispute over policy towards Kashmir. Promising a return to democracy, he ruled as Chief Executive until 2001, when he declared himself President. A referendum in 2002 confirmed him in this office and the constitution was restored. Musharraf suspended it again in 2007, but restored it later the same year and was re-elected president. He resigned in 2008 following an opposition victory in parliamentary elections and subsequent moves to impeach him. He lived in exile until 2013, when he returned to Pakistan to contest the presidential election; however, his candidacy was ruled invalid and he was arrested on treason charges for his actions in 2007. In 2016, before his trial was completed, he was allowed to leave the country for medical treatment in Dubai, and has not returned.