Musharraf moved with his family from New Delhi to Karachi in 1947, when Pakistan was separated from India. The son of a career diplomat, he lived in Turkey during 1949–56. He joined the army in 1964, graduated from the Army Command and Staff College in Quetta, and attended the Royal College of Defence Studies in London. He held a number of appointments in the artillery, the infantry, and commando units and also taught at the Staff College in Quetta and in the War Wing of the National Defence College. He fought in Pakistan’s 1965 and 1971 wars with India.
Prime Minister Nawaz Sharif appointed him head of the armed forces in October 1998. Musharraf is believed to have played a key role in the invasion of the Indian-administered portion of the disputed Kashmir region in the summer of 1999. Under international pressure, Sharif later ordered the troops to pull back to Pakistani-controlled territory, a move that angered the military.
On October 12, 1999, while Musharraf was out of the country, Sharif dismissed him and tried to prevent the plane carrying Musharraf home from landing at the Karachi airport. The armed forces, however, took control of the airport and other government installations and deposed Sharif, paving the way for Musharraf to become head of a military government. Although he was generally considered to hold moderate views and promised an eventual return to civilian rule, Musharraf suspended the constitution and dissolved parliament.
He formed the National Security Council, made up of civilian and military appointees, to run Pakistan in the interim. In early 2001 he assumed the presidency and later attempted to negotiate an agreement with India over the Kashmir region. Following the September 11 attacks in 2001 in the United States and the subsequent U.S. invasion of Afghanistan later that year, the U.S. government cultivated close ties with Musharraf in an attempt to root out Islamic extremists in the Afghan-Pakistan border region.