ISLAMABAD, Pakistan - Pakistan's chief justice ordered the immediate release of detained opposition members Thursday as President Gen. Pervez Musharraf formalized his disputed candidacy for a new five-year term.

Chief Justice Iftikhar Mohammed Chaudhry issued the edict after summoning police and government officials to explain who signed an order to close roads into the capital Thursday to prevent a planned lawyer-led protest against Musharraf.

State television reported that the court had ordered the release of Javed Hashmi, acting leader of the party of exiled former prime minister Nawaz Sharif, and all other political detainees.

Deputy Information Minister Tariq Azim said Chaudhry's decision "will be fully implemented."

Hashmi confirmed to The Associated Press late Thursday he had been freed from a jail in Rawalpindi, near the capital, along with 44 other opposition activists.

Ameer ul-Azeem, a spokesman for the opposition Muttahida Majlis-e-Amal, or United Action Forum, called Chaudhry's order "a slap in the government's face."

"This is good news for us as over 600 MMA leaders and workers have been arrested so far," ul-Azeem said. "The Supreme Court order gives us hope but and a lash to the government, but still I am doubtful that all of our workers would be released."

About 200 people, including opposition leaders, have been taken into custody nationwide since Saturday night, officials have said. Opposition parties claim the number is much higher.

The detentions have prompted sharp criticism, including from the U.S., Musharraf's biggest international ally. The government has defended the arrests as necessary to maintain law and order.

Musharraf has seen his popularity and power erode since his botched effort to fire the independent-minded Chaudhry earlier this year. Lawyers led mass protests for the judge's reinstatement, claiming Musharraf was illegally interfering in the judiciary.

But the ruling coalition remains confident it has enough votes among lawmakers to win Musharraf's re-election. Prime Minister Shaukat Aziz went to the Election Commission on Thursday, along with some of the other 16 legislators, to file the general's nomination papers.

Another 42 candidates also submitted their papers to run in the Oct. 6 vote, including retired Justice Wajihuddin Ahmed, nominated by activist lawyers; and Makhdoom Amin Fahim, vice chairman of former Prime Minister Benazir Bhutto's Pakistan People's Party.

With Bhutto's party still holding out hope of a power-sharing deal between Bhutto and Musharraf after parliamentary elections due by January, Fahim only plans to run if Musharraf is disqualified by the Supreme Court. Critics say Musharraf cannot run while remaining army chief.

Lawyers said Wednesday they would defy a ban on gatherings of more than five people in Islamabad to protest Musharraf's candidacy. But only about 150 reached the Election Commission and the nearby Supreme Court because of the thousands of police guarding the area.

"Why are they scared of peaceful protest? This is our basic right," said Munir Malik, president of the Supreme Court Bar Association.

The Supreme Court, considering several legal challenges to Musharraf's candidacy, is expected to rule within days.

Aitzaz Ahsan, a lawyer adviser to the court, told the justices the constitution barred military officers from seeking political office and the Election Commission should reject his nomination to "once and for all close the door" to military intervention in politics.

But another court-appointed lawyer argued that Musharraf was qualified, urging the judges to keep in mind that the country is still making a transition from military rule.

Meanwhile, an opposition alliance comprising the Islamist Muttahida Majlis-e-Amal and Sharif's party announced that their lawmakers would quit the national and four provincial assemblies Oct. 2 in a bid to block the election -- three days later than initially planned.

The MMA government in North West Frontier Province also plans to dissolve the provincial assembly there.

"If one assembly is dissolved, there will be no presidential election," said Zafar Iqbal Jaghra, a senior leader in the coalition. The Musharraf administration denies it.

The electoral college for the presidential vote comprises all lawmakers of the national and provincial assemblies.

Musharraf, who seized power in a 1999 coup, has pledged to step down as military chief and restore civilian rule if he gets a fresh mandate. But a government lawyer said Tuesday the general would remain army chief if he is not re-elected.

That has fueled opposition claims, denied by the government, that Musharraf will declare a state of emergency if the court blocks his candidacy.