Mohamed Mursi's early challenge to the army and his imposition of an Islamist-tinged constitution were fateful moments in his turbulent year as Egypt's first freely elected president.
A year ago, the Muslim Brotherhood seemed about to reap the fruits of the popular uprising that had toppled Hosni Mubarak, with Mursi installed in the palace he occupied for 30 years.
Now, with the army unceremoniously removing him to wild acclaim from streets packed with Egyptians who had once demanded Mubarak's removal and then an end to the military rule that followed, the movement's future appears at best uncertain.
Armed with only a narrow voter mandate - and a sense of entitlement that his once-oppressed Muslim Brotherhood could finally blaze its own trail - Mursi locked himself into confrontation with a vociferous but rudderless opposition.
He provided few remedies for rampant insecurity and an inherited economic crisis that have made life increasingly desperate for many of Egypt's 84 million people.
As the International Crisis Group put it: "It is difficult to discern who has been more short-sighted: an arrogant Muslim Brotherhood that misread electoral gains for a political blank-check or a reckless opposition that has appeared ready to sink the country in order to bring down the Islamists..."
An unfortunate appearance on German television, where Mursi bemused his audience with comments in stilted English on road safety, made him the butt of a satirical TV show at home and resulted in mocking slogans gleefully circulated by opponents.
Yet Mursi had made a striking start. Six weeks after taking office on June 30, 2012, he surprised almost everyone by taking on the military, which had supplied Egypt's rulers for 60 years and had overseen the bumpy post-Mubarak transition.
Mursi, a stout, bearded, conservative Brotherhood apparatchik who had been the movement's second-choice presidential candidate, abruptly pushed Field Marshal Hussein Tantawi, Mubarak's veteran armed forces commander and defense minister, into retirement.
He also annulled the constitutional amendments giving the generals wide powers that the interim military council headed by Tantawi had decreed before handing over to civilian rule. The army, with its privileges still intact, quietly yielded.
MILITARY BITES BACK
"Mursi has done within two months something that took the Turks 20 years," said a Western diplomat at the time, referring to Turkey's struggle to tame its assertive military.
That judgment has proved premature, although Rami Khouri, a Beirut-based commentator, saw it more as a missed opportunity.
"Civilian authority could have been institutionalized in Egypt had the Muslim Brotherhood acted more democratically and efficiently," he told Reuters.
Before his ultimatum to Mursi on Monday, General Abdel Fattah al-Sisi, appointed by the president to replace Tantawi, had said the army would stay out of politics, even as he urged feuding politicians to end their disputes and head off unrest.
Military concern about Mursi's governance boiled over when he attended a June 15 rally at which hardline fellow Islamists called for holy war in Syria, army sources say.
Sunni Muslim clerics at the rally denounced as "infidels" both the Shi'ites fighting to protect Syrian President Bashar al-Assad and the non-Islamists who oppose Mursi at home.
Mursi himself called for foreign intervention in Syria against Assad, leading to a veiled rebuke from the army, alarmed by the prospect of a new generation of Egyptian jihadis going abroad and then bringing their radical agenda home.
Apart from misjudging army intentions, Mursi miscalculated in last year's struggle over a new constitution for Egypt, which pitted the Brotherhood and its now mostly alienated Islamist allies against their leftist, liberal and revolutionary foes.
On November 22 Mursi boldly awarded himself almost unlimited temporary powers in what his opponents denounced as a return to dictatorship. His decree shielded from legal challenge a mostly Islamist assembly that was drafting the new constitution.
He used his extra prerogatives to sack the Mubarak-era prosecutor general, pursuing a tussle with a judiciary seen by the Brotherhood as hostile to rising Islamist power.
STORM OVER CONSTITUTION
Days of violent street protests erupted, but the assembly rushed through the Islamist-influenced document. Mursi then relinquished his extraordinary powers, but did not delay a referendum in which the Brotherhood and its allies used their electoral muscle to get the constitution approved in December.
Mursi often complained that his opponents refused to work with him, but his failure to build a consensus over the constitution may have helped doom his presidency.
"Taking the oath of office before the people in Tahrir Square and then ignoring the values he expressed there," was a defining moment, Khouri said, faulting Mursi for "ramming down people's throats the imperfect constitution and being forced to make concessions afterwards".
Shortly before he was deposed, Mursi was hailing civilian control over the military as one of Egypt's major gains, but Robert Springborg, a professor at the Naval Postgraduate School in Monterey, said this had been an illusion.
"The constitution did nothing to enhance civilian control and if anything reduced it," he said. "Mursi was referring to his and the Brothers' personal relations with the high command, relations that were of course subject to change as we now see."
In November, Mursi brokered an end to a brief Israeli-Hamas war in the Gaza Strip, gaining him kudos in Washington and reassuring the West that Islamist rule would not end a regional order underpinned by Egypt's 1979 peace treaty with Israel.
But, Springborg argued, foreign policy flipflops suggested that Mursi was more intent on enhancing the Brotherhood's standing than on safeguarding Egypt's national interests.
"Foreign policy bounced from being pro- to anti-Iranian; wary of Syrian engagement to calling for jihad there; cozying up to Saudi Arabia to a cold war with it," he said.
For millions of Egyptians, foreign policy or constitution-drafting mattered less than the inability of Mursi and the Brotherhood to keep their promises to tackle economic problems aggravated by political conflict, crime and institutional drift.
ECONOMY ON CLIFF EDGE
Mursi had raised expectations, but the Brotherhood's slogan "Islam is the solution" did not remedy sliding living standards.
Egypt had agreed an initial deal with the International Monetary Fund for a $4.8 billion loan in November, but in a telling decision Mursi suspended it less than three weeks later, rescinding tax rises amid unrest over his grab for extra powers.
Talks on the loan, first sought by the interim military council, have stuttered. An IMF team left Cairo in April after 12 days of discussions on economic reforms with no agreement.
Egypt has secured stopgap finance from Qatar and Libya, and the government has rationed fuel and wheat imports to save scarce hard currency. Tourism and investment have plummeted.
The latest crisis threatens more pain for the most populous Arab nation, which has run through more than $20 billion in reserves since Mubarak's fall, borrowed billions from abroad and delayed payments to oil companies to support the pound, which has lost 20 percent of its dollar value since December.
Egyptians have seen real incomes shrinking and petrol queues lengthening, enhancing the appeal of a protest movement rooted in a liberal opposition unable to match Islamists at the polls.
"Mursi has alienated the other forces, he didn't handle the economy well and he made many enemies - in the courts, in the army, the police, the media," said Khalil al-Anani, a senior fellow at Washington's Middle East Institute currently in Cairo.
For Khouri, the Beirut-based commentator, Mursi's downfall lay in his "sustained amateurism and incompetence in governing the country and not respecting democratic and pluralistic sensibilities among all Egyptians".
As his circle of friends tightened to the likes of the former armed jihadists of al-Gamaa al-Islamiya, Mursi found it ever harder to convince critics they could trust him.
"In a year he has gone from having widespread support among most political factions to having no support outside the Muslim Brotherhood and probably even strongly eroded support within it," said Springborg, the U.S. academic.
"The key mistake leading to this disastrous outcome was to think he and the Brotherhood could run the country as if it was their personal fief, installing their people throughout the state structure and seeking to gain control of economic assets."