A political crisis erupted in the Afghan capital over the weekend after a special investigative court found that 62 legislators had won their seats by fraud last year and ordered them removed from parliament. The legislators vowed to remain and threatened to stage street protests, while a majority of sympathetic lawmakers voted to fire the attorney general and six Supreme Court justices.

“This is like the revolution in Tunisia,” declared Hafiz Mansour, a lawmaker disqualified by the tribunal, which was convened by President Hamid Karzai. “Mr. Karzai wants to show he can do whatever he wants, even if it violates the law and the constitution. Instead, he has brought the entire parliament together against him. We are not leaving.”

Critics portrayed the situation differently, calling the rebels obstructionists and ballot-box cheaters. They said the disqualified lawmakers were bent on provoking a clash among Afghanistan’s weak democratic institutions just when the Karzai administration needs to show it can effectively govern and protect the nation as U.S. forces and aid programs begin a three-year withdrawal.

Supporters of the president, including several respected politicians who lost in 2010 but will be reinstated in parliament if the tribunal’s actions stand, said that the judicial panel had done its work properly and that the legislature had no legal right to try to fire the state’s head prosecutor and senior judges in revenge.

“These people were caught red-handed. They are calling the tribunal illegal, which is absurd,” said Daoud Sultanzoy, a former legislator who led a lawsuit by colleagues who believed they were robbed of their seats in 2010. He said some newly disqualified lawmakers with unsavory pasts had set up armed compounds near the parliament. “They want to threaten the executive and the judiciary, too,” he said. “We cannot let things fall into their hands.”

With the three branches of government at a tense stalemate, and some lawmakers calling for Kar­zai’s impeachment, the capital seemed transfixed by the political tempest. Figures on both sides of the fight tried to project a patriotic image while whispering that various rival legislators had family ties to Karzai’s relatives or aides, former militia bosses, or even members of the special tribunal.

The confrontation had been building for months, as the panel’s probe continued and Karzai refused to present cabinet nominees for vetting by parliament. It has been viewed with alarm by foreign diplomats whose governments and agencies have spent many millions of dollars trying to help Afghan leaders build a professional government and a solid democratic system after years of war and political chaos.

U.S. Ambassador Karl W. Eikenberry tried Saturday to portray the crisis in a sympathetic light, comparing it to difficulties with past American elections. “It’s complicated,” he told a group of Afghan journalists here. “Your executive branch is involved. Your legislative branch is involved. The judicial branch is involved.” He said that it was important that official decisions be “grounded in the constitution and the rule of law” but that the crisis was “ultimately for the Afghan people to resolve.”

U.N. officials here issued a similar statement Sunday after a group of disqualified lawmakers called on them for support. The officials said that Afghan institutions “must resolve these election issues in accordance with the constitution” and that members of parliament “should act responsibly” and “not resort to sit-ins, protests or other actions which could provoke public unrest.”

Spokesmen for the Karzai administration tried to frame the problem in strictly legal terms, rejecting accusations of political manipulation. Sifatulla Safai, head of the government’s media center, said the judiciary “is an independent organ, and the government does not want to interfere in its affairs. It is a legal issue and can be resolved through judicial channels.” The attorney general’s office said it would move soon to carry out the tribunal’s orders.

Yet inevitably, the clash focused on the president and his efforts to dominate the government. As Karzai’s popularity has declined, his public comments have become more harsh and accusatory. He has castigated his Western allies and turned toward traditional tribal networks for support. Critics said he deliberately provoked the clash with parliament in an effort to weaken it.

“This is a sad situation but not a surprise,” said former foreign minister Abdullah Abdullah, Karzai’s chief rival in the 2009 presidential election. “The parliamentary election was far from perfect, but Mr. Karzai is trying to delegitimize all other institutions and extend his one-man calamity rule beyond its constitutional mandate. The result is a political crisis that this nation cannot afford.”

Special correspondent Sayed Salahuddin contributed to this report.