ISLAMABAD — A Pakistani court on Tuesday sentenced the country's former military ruler Gen. Pervez Musharraf to death in a treason case related to the state of emergency he imposed in 2007 while in power, officials said.

It's the first time in Pakistan's history that a former army chief and ruler of the country has been sentenced to death. Musharraf, who was sentenced in absentia, has been out of the country since 2016, when he was allowed to leave on bail to seek medical treatment abroad.

He has been living in Dubai, the United Arab Emirates, and is said to be very ill and unlikely to travel home to face the sentence. Pakistan and the U.A.E. have no extradition treaty and Emirati authorities are unlikely to arrest Musharraf. If he were to return, however, Musharraf would have the right to challenge his conviction and sentence in court.

The ruling Tuesday by a three-judge panel was not unanimous and one of the judges had opposed the death sentence, according to Akhtar Sheikh, one of the lawyers of Musharraf.

After the sentence was announced, Pakistan's Information Minister Firdous Ashiq Awan told reporters that Prime Minister Imran Khan's government would “review in detail” the verdict before commenting on it.

In an infamous purge in 2007, Musharraf imposed a state of emergency and placed several key judges under house arrest in the capital, Islamabad and elsewhere in Pakistan. He came to power after ousting former Prime Minister Nawaz Sharif in a 1999 bloodless coup.

Pakistani policemen stand guard outside a special court after a court verdict against former military ruler Pervez Musharraf, in Islamabad. Aamir Qureshi / AFP - Getty Images

Later, when he was back in office, Sharif first accused Musharraf of treason in 2013 and the general was formally charged in 2014.

Musharraf was again hospitalized last week in Dubai. Earlier, in a video message he released two weeks ago, Musharraf said he was ready to record his statement about the treason case through a video link but that he was unable to travel to Pakistan.

Sharif himself was ousted in 2017 and was later convicted of corruption. He left Pakistan on bail earlier this month to travel to London for medical treatment.

Sharif's spokesman Ahsan Iqbal praised Tuesday's ruling, saying Musharraf deserved the death sentence because he had ousted an elected government. “We welcome this court ruling,” Iqbal said, adding that the judges had done justice to a former dictator.