General Pervez Musharraf, who seized power in a bloodless coup and later led Pakistan reluctant to help in the US war in Afghanistan against the Taliban, has died, an official said Sunday. He was 79 years old.

Musharraf, a former special forces commando, became president through the latest in a series of military coups that have rocked Pakistan since its founding amid the bloody partition of India in 1947. He ruled the state with nuclear weapons after his 1999 coup via tensions with India, an atomic proliferation scandal and an extremist Islamic insurgency. He resigned in 2008 while facing possible impeachment.

Later in his life, Musharraf lived in self-imposed exile in Dubai to avoid criminal charges, despite attempting a political comeback in 2012. But it was not to be, as failing health plagued his later years.

Musharraf’s family announced in June 2022 that he had been hospitalized for weeks suffering from amyloidosis, an incurable condition in which protein builds up in the body’s organs.

Shazia Siraj, a spokeswoman for the Pakistani Consulate in Dubai, confirmed his death, saying diplomats were providing support to his family.

Pakistan, a nation nearly twice the size of California along the Arabian Sea, is now home to 220 million people. But it would be its border with Afghanistan that would soon catch the eye of the United States and dominate Musharraf’s life just under two years after he seized power.

The US-led invasion of Afghanistan saw Taliban fighters flee across the border back into Pakistan, including Osama bin Laden, whom the US would kill in 2011 at a compound in Abbottabad. They regrouped and the Pakistani Taliban branch emerged, beginning a years-long insurgency in the mountainous Afghanistan-Pakistan border region.

Militants attempted to assassinate Musharraf twice in 2003 by attacking his convoy, first with a bridge bomb and then with car bombs. That second attack saw Musharraf’s vehicle thrown into the air by the blast. He ran to safety on just his tires, Musharraf pulling out a Glock pistol in case he had to fight his way out.

Born on August 11, 1943 in New Delhi, India, Musharraf was the middle child of a diplomat. His family joined millions of other Muslims in fleeing west when predominantly Hindu India and Islamic Pakistan seceded during independence from Britain in 1947.

Musharraf joined the Pakistani army at the age of 18 and made his career there while Islamabad fought three wars against India. He would launch his own attempt to seize territory in the disputed Himalayan region of Kashmir in 1999, just before taking power from Prime Minister Nawaz Sharif.

As ruler, Musharraf came close to reaching a deal with India over Kashmir, according to US diplomats at the time. He also worked to achieve a rapprochement with the old rival Pakistan.

Musharraf’s internal support eventually eroded. He held flawed elections in late 2002, only after changing the constitution to give himself sweeping powers to fire the prime minister and parliament. He then reneged on his promise to retire as army chief by the end of 2004.

The anger of militants and citizens towards Musharraf increased in 2007 when he ordered a raid on the Red Mosque in central Islamabad. It had become a sanctuary for militants opposed to Pakistan’s support for the Afghan war. The week-long operation killed more than 100 people.

Fearing that the judiciary would block his continuation of rule, Musharraf fired Pakistan’s chief justice. That triggered massive demonstrations.

Under pressure at home and abroad to restore civilian rule, Musharraf resigned as army chief. Although he won another five-year presidential term, Musharraf faced a major crisis following the assassination of former prime minister Benazir Bhutto in December 2007 at a campaign rally as she was seeking to become prime minister for the third time.

The public suspected Musharraf’s hand in the murder, which he denied. A subsequent United Nations report acknowledged that the Pakistani Taliban were prime suspects in his assassination, but warned that elements of Pakistan’s intelligence services may have been involved.

Musharraf resigned as president in August 2008 after ruling coalition officials threatened to oust him for imposing a state of emergency and firing judges.

Subsequently, he lived abroad in Dubai and London. Instead, Pakistan arrested the former general on treason charges over the Supreme Court debacle and other charges stemming from the Red Mosque raid and Bhutto’s assassination.

Pakistan allowed him to leave the country on bail to Dubai in 2016 for medical treatment, and he remained there after facing an overturned death sentence later.