Updated

Pakistan's top court acquitted opposition leader Nawaz Sharif on Friday of hijacking charges stemming from the 1999 coup against his government, clearing the last obstacle to his running for office.

Sharif was banned from office after being found guilty of hijacking Gen. Pervez Musharraf's plane in 1999. Sharif was prime minister at the time, while Musharraf was the head of Pakistan's army. Sharif has insisted the ban was politically motivated.

In its ruling on Friday, the Supreme Court said there was no evidence to support the hijacking charge and acquitted Sharif of all charges. Prosecutor Shahadat Awan said the court's decision was unanimous.

Sharif spokesman Sadiqul Farooq hailed the ruling, and said it brought a close to the final criminal case against the two-time prime minister, paving the way for his return to public office.

"We knew that Nawaz Sharif is innocent, but today's court order also proved that he had been wrongly convicted," Farooq said.

Friday's ruling was the third in the past two months to lift a ban on Sharif's participating in elections.

The army ousted Sharif's government in a bloodless coup on Oct. 12, 1999, the day Sharif removed Musharraf from his post as army chief and refused to allow the general's plane to land at a Karachi airport while returning from a foreign trip. The army revolted.

After assuming power, the military government charged Sharif with ordering the hijacking of Musharraf's plane. Sharif argued that his actions only aimed to avert a coup that was already under way.

After his government's ouster, Sharif went into exile in Saudi Arabia. He returned home in 2007 and filed an appeal against his conviction in the hijacking case.

Earlier this year, the Supreme Court ruled Sharif was not eligible for office because of the criminal conviction on hijacking charges. That prompted him to lead nationwide protests against the shaky government of President Asif Ali Zardari.

Sharif — the country's most popular politician, according to polls — has made no secret of his desire to return to his position as prime minister but has said he does not want early elections.

Sharif's party came second in parliamentary elections last year, behind the party of Zardari. The two parties originally formed a government together, but within a few months Sharif's party moved to the opposition. It accused Zardari of reneging on a vow to restore judges fired by Musharraf, who stepped down as president last year.

Political analyst Hasan-Askari Rizvi said Friday's court ruling could lead to better ties between Sharif and Zardari and "will contribute to the stabilization of the political scene because it removes a major irritant" in the parties' relations.

Sharif and Zardari were expected to meet later Friday in Lahore, Farooq said.