By MATT BRADLEY, CHARLES LEVINSON and TAMER EL-GHOBASHY

CAIRO—Egypt's divided political opposition witnessed a rare moment of unity on Tuesday as demonstrators from across the political spectrum descended on downtown Cairo to protest a decree by the armed forces extending their grip on power.
The protests came one day before an election commission is expected to announce the final winner in a polarizing presidential race that threatens to spark new unrest.
Both the Muslim Brotherhood's Mohammed Morsi and former regime loyalist Ahmed Shafiq claimed victory in the election.
But the united effort in Tahrir Square offered the first indication that the country's divergent political forces could set aside their differences and unite to check the military leadership's widening hold on Egypt's emerging political system.
"We learned a very hard lesson this week that the military believes we are divided and will allow them to exert their will on us," said Shadi Abdel Rahim, 35 years old. "I don't love Morsi and I don't love Shafiq but I love democracy and that's why I'm here."
In the past two weeks, the interim ruling military leadership has restored martial law, dismissed parliament, cut down the powers of the president and claimed authority over the drafting of the country's next constitution.
The turnout on Tuesday, in the tens of thousands, marked a dramatic increase in the strength of the antimilitary opposition and its power to coral the Islamists and secular-minded activists who have spent much of the past year at odds.
"No Salafi, no liberal, no Brotherhood, today it's only Egyptian," sang one large group of protesters who arrived shortly before sunset in Tahrir Square, which was the focal point of the uprising that ousted former President Hosni Mubarak.
When Egypt's Supreme Constitutional Court dissolved parliament two weeks ago, the outrage was barely felt. Many activists accused the military of orchestrating a soft coup, but the few calls for mass protest were largely ignored. Some liberal-minded politicians, including those who have been critical of military rule, publicly praised the court's decision to dissolve the Islamist-dominated assembly they said was a prelude to an Islamist putsch.
Egypt's political future was hanging in the balance on Tuesday as rival campaigns claimed victory. In a news conference at their downtown headquarters on Tuesday morning, the Muslim Brotherhood announced that Mr. Morsi had won 52% of the vote to Mr. Shafiq's 48%.
In another news conference across town, campaigners for Mr. Shafiq said their candidate was in the lead with 51.5% of the total ballots.
In a sign of legal battles to come, a Shafiq campaign manager announced that Mr. Shafiq and his supporters are "prepared to go to the furthest point possible to prove that Shafiq is Egypt's next president."
At an earlier news conference across town, the Brotherhood presented reporters with reams of paperwork attesting to their candidate's victory. When Egyptian journalists pressed Mr. Shafiq's media representatives for hard numbers, the campaign workers demurred, insisting that this week's official announcements of results would vindicate their claim.
Write to Matt Bradley at [email protected], Charles Levinson at [email protected] and Tamer El-Ghobashy at [email protected]