THE hounding from power of Egypt’s president, Muhammad Morsi, the Muslim Brother who was elected a year ago, leaves the most populous and influential country in the Arab world in a dangerous state of flux, and it will have sweeping implications for politics across the Arab world—Egypt has always been a bellwether for its region. On June 30th, when as many as 14m protesters poured into streets in towns and cities across the country, the Egyptian army issued an ultimatum calling on Mr Morsi to “meet the demands of the people” baying for his departure. Egypt’s Islamists, as well as columnists in Western newspapers, were quick to decry an impending military coup. As was the case with the fall of Hosni Mubarak in February 2011, Egypt’s large, disciplined and professional army was taking upon itself the duty of sweeping away a collapsing administration and stepping into the breach.

This it did on July 3rd, when armoured vehicles started to roll out. In the evening the army announced a transition plan developed in consultation with opposition leaders and religious figures. The Brotherhood-crafted constitution passed by a referendum late last year has been suspended; a committee will revise it. The supreme court will issue a new electoral law for early parliamentary and presidential elections. Nearly all political parties, including Salafist former allies of the Brotherhood, have endorsed the road map. Adly Mansour, a supreme-court judge, will be interim president.

The Tahrir-Square-filling tactics that took three weeks to topple Mr Mubarak two years ago did the same trick in just three days this time, and this swift, dramatic ouster was greeted by an even greater cacophony of joy than the previous one.

One might have expected Egyptians to be especially wary of military intervention. The period of army rule between the fall of Mr Mubarak and Mr Morsi’s election was marked by hamfisted management, maladroit politics and vicious human-rights abuses. Before that, Egypt had suffered six decades of increasingly corrupt, army-dominated government behind a façade of civilian presidents, all of whom had previously been army officers. It should have seemed a dangerous precedent to have the army cut short Egypt’s barely-started first experiment with full-scale democracy.

Yet judging by the ecstatic roars with which the crowds in Tahir square have greeted fly-pasts by army helicopters, the majority of Egyptians have decided to bury their doubts and ugly memories. Recent opinion polls suggest the army remains by far the most trusted institution in the country. Many believe the generals’ promise that they have no desire to linger in politics. Many also see them as or better equipped than squabbling politicians to get Egypt’s revolution back on track. These people yearn for a return to the stability that the military is seen as guaranteeing.

They also yearn for a more comforting and inclusive notion of what it is to be Egyptian. The Brotherhood’s Islamist rule posed questions about Egypt’s national identity that had been long postponed under decades of dictatorship. The underlying quandary was whether Egyptians should be defined chiefly by their faith, as Islamists see it, or rather as free participants in a pluralist society with shared values.

Egypt’s small number of outright secularists, as well as its Coptic Christians and Shia Muslims, were never going to be happy under the Brothers. A large number of middle class, better educated folk was also suspicious of a secret society which believed itself both morally superior to them and more Egyptian. The surprise has been how quickly much of Egypt’s vast, ideologically uncommitted political centre has turned from the group. Many of these people tilted in the Brotherhood’s direction in the 2012 elections because they thought they were clean and competent. Disabused of those notions and alienated by the Brotherhood’s attitude in power, they have now turned away.

As Mr Morsi’s fatal anniversary approached on June 30th, the Brotherhood appeared increasingly isolated. An opinion poll in June found that 64% of respondents thought the party had performed worse in government than they had expected. Asked to name the best decision Mr Morsi had made as president, 73% answered that he had made no good decisions.

He will not be making any more decisions as president, now. The crowds are still cheering. Yet once the euphoria has died down, the situation will look grim. When Mr Mubarak was overthrown, Egypt’s economy was fairly healthy, its institutions intact, if creaky and the country pretty much united. Citizens of every class and ideological slant banded together around the simple, easily stated aim of dislodging a dreary and discredited leader. Now, the country’s economy and institutions are much the worse for wear, and its 84m people are dangerously divided. The hard core of the Brother’s support is a minority of the country, but not a negligible one. And though the army and secular politicians speak of the need for inclusiveness the military has abruptly shut down pro-Brotherhood broadcasters. In the past, Egypt’s Islamists have proven most dangerous and prone to violence when shut out of the system.

The Brotherhood has learned that for all Egyptians’ powerful attachment to their faith, in politics they want practical results. This may yet see the Brothers modernise, in Egypt and elsewhere. Or it may see a turn to something darker and more desperate.