Pakistan's new Supreme Court has - as expected - dismissed the final legal challenge to the recent re-election of President Pervez Musharraf.
Gen Musharraf is under pressure to lift emergency rule
Gen Musharraf's opponents had argued that his election was illegal because he was still head of the army.
The move clears the way for the general to resign as army chief, as promised, and be sworn in as a civilian leader.
He has vowed to "do his utmost" to end emergency rule before elections in January, UK leader Gordon Brown says.
President Musharraf is widely believed to have declared the 3 November state of emergency in order to purge the Supreme Court that he suspected was about to rule against his re-election, says the BBC's Barbara Plett in Islamabad.
"Dismissed," Chief Justice Abdul Hamid Dogar said in court after hearing the last petition on Thursday, reports Reuters news agency.
Gen Musharraf's top legal adviser, Sharifuddin Pirzada, told Reuters there was now no legal obstacle to his re-election.
"Now the court has to give us this in writing," he said.
Mr Chaudhry was removed as the chief justice
The verdict was expected to go in Gen Musharraf's favour since he has appointed new judges to the bench who are considered more loyal.
President Musharraf has still not lifted emergency rule, despite pressure from his Western allies.
He says the parliamentary and provincial elections, due to be held in January, can take place under the emergency decree.
Pakistan has asked the Commonwealth, whose leaders are meeting in Uganda, to delay its decision on whether the country should be suspended.
The decision was provisionally expected on Thursday.
Speaking shortly before leaving for Uganda, British Prime Minister Gordon Brown said he had spoken to President Musharraf on Wednesday night.
"He has assured me that he will do his utmost to lift the state of emergency in time for free and fair elections to be held and to give up his military role and responsibilities as soon as possible," Mr Brown told reporters.
Former Prime Minister Benazir Bhutto, leader of Pakistan's main opposition party, is yet to decide whether to boycott what she says will be a "flawed election".
On Thursday, her Pakistan People's Party said it would allow its candidates to file nomination papers while it continued talks with other opposition parties. But a statement said the party reserved the right to review its decision at a later date, leaving the option of a boycott open.
Other opposition leaders like Imran Khan have already said they will not take part in the elections.
Meanwhile, the party of exiled former Prime Minister Nawaz Sharif says he will meet Saudi Arabia's King Abdullah on Friday to discuss his plans to return to Pakistan.
A party spokesman, Ahsan Iqbal, said Mr Sharif travelled to Riyadh on Thursday on a plane sent by the king.
The development comes a day after President Musharraf returned from talks in Saudi Arabia with King Abdullah.
Mr Sharif tried to return from exile in September, but was deported shortly after he landed in Islamabad.