AT THE height of the Arab spring in 2011, protesters in Cairo’s Tahrir Square sought to overthrow the country’s military rulers of six decades. They paid a heavy price in blood—and did not wholly succeed. Hosni Mubarak, the president (and a former air-force commander), was ousted and jailed. But many of the uniformed men around him stayed in power, coexisting uneasily with a gaggle of strutting revolutionaries.

That coexistence is now over. With a cool, calm announcement on August 12th, the army has been effectively sidelined by Muhammad Morsi, the newly elected president, who comes from the Muslim Brotherhood, an Islamist group (see article). His scalps include Field-Marshal Muhammad Tantawi, the longtime defence minister who became Egypt’s de facto ruler after Mr Mubarak’s fall, his deputy on the secretive Supreme Council of the Armed Forces (SCAF) and several other ancient generals.

This move has not stripped the armed forces of all their power. As in many Arab and African countries, they will retain political clout. Their economic interests—comprising perhaps a tenth of GDP—are untouched. The new defence minister, Abdel Fattah al-Sisi, is a young member of the SCAF who ran its intelligence department. He is hardly a reformer and certainly no Islamist. But he seems to have struck a deal with the Muslim Brothers. The announcement of his seniors’ retirement, to which none of them publicly objected, was swiftly followed by his endorsement as defence minister.

But, as a raw display of both Mr Morsi’s power and that of the Muslim Brothers, the pithy retirement announcement by the president’s spokesman on August 12th was hard to beat. The group that was only one of many actors in the Arab spring has now become Egypt’s dominant political force. After decades of persecution, the Brothers have sent off their erstwhile adversaries with a mocking thank-you and the country’s highest honour, the Collar of the Nile. Mr Morsi also cancelled a recent military order giving the generals special political privileges, including oversight of the drafting of a new constitution. And he has publicly called himself supreme commander of the armed forces, without objection.

It remains to be seen if the Mubarak-era supreme court will go along with this power grab. Some Egyptians hope it will not. They see the armed forces as the guarantor of secularism and the last defence against the rise of fundamentalism. They fear the rising power of a group tainted by elements of anti-democratic sectarianism. Cairo’s liberals are so jumpy that talk of allowing policemen to grow beards is seen as a step on the road to turning Egypt into an Islamic Republic modelled on Iran; though the prosecution of two journalists for apparently insulting Mr Morsi gives genuine cause for concern.

Aside from that, Mr Morsi has so far exercised power with care. He has appointed a diverse cabinet, which includes a Copt and figures from the Mubarak era. He has made no move to tear up the Camp David accords of 1979 that secured peace with Israel. So long as he continues to uphold constitutional government and respect human rights, the defenestration of the generals should be welcomed, for no democracy can thrive while the armed forces hold most of the power.

It’s up to you

Easing the armed forces out of power was one of Mr Morsi’s main challenges. He now faces another two crucial tests.

The first and most immediate is the writing of a new constitution, which needs approval in a referendum and should then pave the way for a fresh parliamentary election. A cumbersome poll earlier this year was ruled invalid by the courts, so Mr Morsi now has near-dictatorial powers. He must use them sparingly or risk losing legitimacy. Egyptians are in no mood to swap one strongman for another.

The second big test for the new president is the economy. Uncertainty following the Arab spring has damaged business confidence. Investors are staying away. Tourists, previously a big source of income, have become so scarce that some guides at the pyramids have sold their camels to butchers. Big reforms of a sclerotic state sector are urgently needed. Judging by his bold sacking of Egypt’s most senior generals, Mr Morsi has the necessary courage to make them. The question is whether he and the Brothers have the will.