Pakistan's new prime minister ordered on Monday the release of judges detained by President Pervez Musharraf, triggering a showdown with the US-backed leader just minutes after being elected.
Yousuf Raza Gilani, a key aide to slain opposition icon Benazir Bhutto, immediately promised to free the judges Musharraf ordered held in November amid fears they might challenge his grip on power in the nuclear-armed nation.
Legislators cheered as the 55-year-old Gilani, who himself spent five years in prison under Musharraf's regime, was elected overwhelmingly by the lower house of parliament -- where an anti-Musharraf coalition now holds a majority.
"Today, democracy has been restored thanks to the great sacrifice of Benazir Bhutto," Gilani, wearing a dark suit and tie, said in his first speech to parliament.
"I invite all political forces to join us because the country is facing such a crisis that a single man cannot save it," Gilani said to chants of "Go Musharraf, Go!" and "Long Live Bhutto!"
He quickly established that he was ready to take on the president, who is due to swear him into office on Tuesday. Gilani said the judges detained and turfed out of office by Musharraf would go free.
Musharraf deposed Chief Justice Iftikhar Muhammad Chaudhry and dozens of other judges under a state of emergency in November, when it looked like the Supreme Court might overturn his October re-election as president.
"I order all the detained judges to be released immediately," Gilani said, referring to Chaudhry and several other judges who remain under house arrest after more than four months.
Police with forklift trucks began removing barbed wire and concrete barricades outside the Islamabad neighbourhood where the judges were being held.
An aide to Chaudhry said he was grateful to Gilani and would leave his house on Tuesday. The judge's son appeared on the balcony of the house where he too has been held since November, AFP correspondents witnessed.
"I have just met the chief justice, he has thanked the prime minister and the new assembly and he has also said that he is praying for the democratic institutions," aide Athar Minallah told AFP.
Gilani himself was in prison for half a decade on corruption charges, which he said were cooked up by Musharraf's regime to discredit him. His spell in prison won him respect within the ranks of Bhutto's Pakistan People's Party.
Her PPP emerged as the biggest party from elections in February and formed a coalition with the party of former premier Nawaz Sharif and two smaller groupings after routing Musharraf's allies.
Bhutto, another former premier, was assassinated at a campaign rally in December. Her teenaged son Bilawal, sitting in the parliament gallery, wiped away tears and then shook hands with Gilani after Monday's vote.
Gilani got 264 votes in the 342-seat chamber, while a pro-Musharraf candidate secured 42 votes. There were several abstentions.
The corruption charges against Gilani dated from his time as speaker during Bhutto's second term in power from 1993 to 1996. He also served as a minister during her first term from 1988 to 1990.
There has been speculation that Gilani will be a stop-gap premier until Bhutto's widower Asif Ali Zardari, who is not an MP, becomes eligible to stand for the post by contesting a by-election in May.
But local daily The News quoted Zardari denying this, saying that he was not interested in the job and that Gilani would be prime minister "for five years and not for three months."
A Pakistani court earlier on Monday acquitted Zardari of involvement in the 1996 murder of a retired judge, his lawyer said.
Musharraf on Sunday pledged his full support to the new coalition, hailing the start of what he called a "real democratic era" in the country, which has been plagued for months by violence linked to Al-Qaeda and Taliban militants.