Egyptian authorities began counting votes for Islamist candidate Mohamed Mursi and Ahmed Shafiq, former President Hosni Mubarak's last premier.

CAIRO — The Muslim Brotherhood declared early Monday that its candidate, Mohammed Morsi, won Egypt’s presidential election, even as the military handed themselves the lion’s share of power over the new president, enshrining their hold on the state and sharpening the possibility of confrontation with the Islamists.

With Parliament dissolved and martial law effectively in force, the generals made themselves the country’s lawmakers, gave themselves control over the budget and will determine who writes the permanent constitution that will define the country’s future.

But as it claimed victory over Hosni Mubarak’s last prime minister Ahmed Shafiq in the election, the Brotherhood challenged the military’s power grab.

The group warned that it did not recognize the dissolution of Parliament or the military’s interim constitution — or its right to oversee the drafting of a new one. That pointed to a potential struggle over spheres of authority between Egypt’s two strongest forces.

Unlimited Digital Access. $1 for 4 weeks.

The Brotherhood has campaigned on a platform of bringing Egypt closer to a form of Islamic rule, but the military’s grip puts it in a position to block that.

At a pre-dawn press conference Monday declaring their win, officials from the fundamentalist group that was banned for decades and repeatedly subjected to crackdowns under Mubarak’s rule were ebullient and smiling, as supporters chanted, “Down with military rule.”

Final official results are not expected until Thursday. The Brotherhood’s declaration was based on results announced by election officials at individual counting centers, where each campaign has representatives who compile the numbers and make them public before the formal announcement.

The group said Morsi took 51.8 percent of the vote to Shafiq’s 48.1 percent out of 24.6 million votes cast, with 98 percent of the more than 13,000 poll centers counted.

The military generals have ruled since Mubarak fell on Feb. 11, 2011.

After a highly polarized presidential election and the miltary’s arrogation of powers to itself, the Brotherhood presented itself as willing to get into a confrontation with the Supreme Council of the Armed Forces, the top generals headed by Field Marshall Hussein Tantawi, Mubarak’s defense minister for 20 years.

Just before the election, the generals slapped de facto martial law on the country, giving military police and intelligence agents the right to arrest civilians for a host of suspected crimes, some as secondary as obstructing traffic.

Then came Thursday’s ruling by the Supreme Constitutional Court dissolving Parliament, followed by the interim-constitution declaration just after polls closed Sunday after two days of voting.

According to a copy of the document, the generals would be the nation’s legislators and control the budget.

They also will name the 100-member panel tasked with drafting a new constitution, thus ensuring the new charter would guarantee them a say in key policies like defense and national security as well as shield their vast economic empire from civilian scrutiny.