A period of 84 years, most of them spent as a proscribed secret society languishing in prison or in exile, is a long time to wait. Egypt's Muslim Brotherhood had to spend one hour more. That was the time it took Farouq Sultan, the head of the election commission, to read out a statement dealing with, it seemed, every one of the 456 objections made as a result of the presidential runoff. When he finally came to the point, Sultan could not get to the end of his sentence before the press conference, Tahrir Square and the country erupted. Mohamed Morsi had become the first Islamist to be elected head of an Arab state.

This is a historic moment for Egypt. Another nail has been hammered into the coffin of the old regime. The reaction of Tahrir Square on Sunday night was every bit as ecstatic as the toppling of Hosni Mubarak himself. Yet power itself has not changed hands, and the conflict with an ageing group of generals in the Supreme Council of the Armed Forces (Scaf) might yet drag on for weeks or months. Scaf thinks it owns the country, and by some reckoning it does. Its corrupt business empire could account for as much as 40% of Egypt's GNP. Like all CEOs, they will not depart swiftly or cheaply. Theirs will be a slow and bitter rearguard action.

But after Sunday's events few can doubt the direction of travel. The generals face a bald choice: declare a military coup or beat the retreat. How long that decision will take, no one knows. The generals now face an incomparably larger and more emboldened foe. The secular leftist and Islamic forces that comprise the revolution are still mutually distrustful and represent an unwieldy spectrum of political forces, many still half-formed.

However, from now on their torchbearer will not just be a crowd hundreds of thousands strong. It will be a president who represents the democratic and constitutional will of the Egyptian people. As Scaf represents neither, it will be hard put to keep the legislative, constitutional and executive powers it grabbed in the dying days of the presidential count.

Much will depend on the character of Egypt's new president. Derided as a spare tyre by the Egyptian press – because he was not the Brotherhood's first choice as presidential candidate – Morsi may be an accidental president, but he may also turn out to be a powerful one. Dismissed as a boring and unquotable technocrat, he produced his best speech on the very night, 11 days ago, the military council issued its constitutional decree.

He is a dogged negotiator and, supporters say, a man of courage. Although the election result was announced on Sunday, it was known on Thursday afternoon. By then it became clear that the number of ballot papers ruled ineligible had not been enough to dent the one million strong lead Morsi had over the army's candidate, Ahmed Shafiq.

The Brotherhood then met the military council and made its three principal demands – that parliament be reinstated, the military's right of arrest of civilians be rescinded, and a new constitutional assembly formed. The Brotherhood offered to put the military's constitutional decree to a referendum. The military refused, and the Brotherhood returned to Tahrir Square.

The three days that followed were a battle of wills that Morsi won. His first act as president-elect was to resign his membership of the Brotherhood. His vice-presidents will all come from other groups, including Egypt's Coptic Christians. All these moves are vital if a government of national unity is to be created.

The battle of wills between Morsi and the generals will continue. And as reaction poured in from the region – notably, Binyamin Netanyahu, Israel's prime minister, said he respected the outcome – the US, Britain and Europe were all notably silent in the hours immediately after the victory, considering this is a triumph not just of one candidate but of democracy. Not for the first time in the Middle East, western powers could have found themselves on the wrong side of history.