(CNN) -- Mohamed Morsy, Egypt's first democratically elected president, has been ousted from office just over a year into his presidency.
Deposed by the military and reportedly held under house arrest, Morsy's fall from power has been nothing if not rapid.
Egypt's powerful military stepped in July 3, hours after a deadline the generals had set for Morsy to order reforms expired.
The military's intervention followed days of opposition protests, during which hundreds of thousands of people massed in Cairo's Tahrir Square and elsewhere to demand that he step down and call fresh presidential elections, or face a campaign of civil disobedience.
The news of Morsy's downfall prompted further mass street demonstrations, with both his opponents and his supporters turning out to celebrate, or protest, his ouster.
Morsy, who is backed by the Muslim Brotherhood, Egypt's oldest and best-organized political movement, insists he remains the country's legitimate leader.
As the deadline neared, he offered to form an interim coalition government to oversee parliamentary elections and revise the constitution that was enacted in January.
But Egypt's top military officer, Gen. Abdel-Fatah El-Sisi, said he "did not achieve the goals of the people" and had failed to meet the generals' demands that he share power with his opposition.
So where did it all go wrong?
A strict Islamist educated in southern California, Morsy was elected Egypt's president in June 2012 after a campaign focused on appealing to the broadest possible audience.
But critics say he became increasingly authoritarian and forced through a conservative agenda during his year in power.
He is also blamed for failing to revive Egypt's economy, which crashed when the 2011 uprising, which toppled longtime strongman Hosni Mubarak, drove tourists away.
That led many of his supporters among Egypt's poor and middle class to become disaffected, said Fawaz Gerges, director of the Middle East Center at the London School of Economics, speaking before Morsy fell.
"That some of the revolutionaries are calling on the army to return to politics is a testament to how polarized Egypt is a year after the election of Morsy," Gerges said. "Think of the millions of people who cheered Morsy after his election. Think of the millions of Egyptians who pinned their hopes on Morsy.
"A year later, now, the millions of Egyptians who cheered for Morsy are saying he must go."
Eric Trager, writing for the New Republic, described an anti-Muslim Brotherhood backlash that is the "product of mounting popular frustrations regarding the organization's failed governance of Egypt" during Morsy's year in office.
Among the causes for complaint are lack of security, rising food prices, long fuel lines, and frequent electricity cuts during the scorching Egyptian summer, Trager said, all of which foster widespread anti-Brotherhood rage.
"The Brotherhood, however, is in complete denial of this. Brotherhood leaders and members contend that Morsi has been a mostly successful president," he said.
For Omar Ashour, a nonresident fellow at the Brookings Doha Center and senior lecturer at Exeter University, Morsy faced an almost impossible challenge from the start.
Inexperienced in campaigning, he and his rivals made a raft of "wild promises" that raised expectations very high, and Morsy could not deliver on them once elected with just over half the vote, Ashour said.
He inherited a huge public debt and a legacy of 30 years of corruption under President Hosni Mubarak. Dissatisfaction with economic conditions in the country was already high.
On taking office, he also experienced very strong resistance from a number within the state institutions, many of them Mubarak loyalists.
The majority of those who backed him in the election are still behind him, Ashour said. But some, including those who voted for Morsy only because the alternative was to see Mubarak's former prime minister elected, have now joined the ranks of those lined up against him.
Those opposed to Morsy include the Mubarak loyalists who seek a return to power; the Salvation Front, a broad coalition of opposition groups; the youth groups who are disenchanted not to see major change after a year; and the average citizen unaffiliated with any group but frustrated by rising costs.
Uncharismatic, not inclusive
Morsy's personal style has contributed to his current predicament, Ashour said.
He lacks charisma and oratorical skills, and at the same time he hasn't been able to back his orders with a stick in the same way that Mubarak and his predecessor, Anwar Sadat, did, he said.
Although the country's deficit has fallen and tourism revenue has slightly improved over the past year, the effects are not being felt by the man and woman on the street, Ashour said, so Morsy has not benefited.
Before his election, there were concerns in some quarters that Morsy and the Muslim Brotherhood would seek to introduce a fundamentalist Islamic theocracy.
But Ashour rejects the idea that the discontent is ideologically motivated, saying it is in fact a "pragmatic" power struggle between those who won the democratic election and those who lost, as well as those who feel they lost out in Egypt's 2011 revolution.
Shadi Hamid, director of research for the Brookings Doha Center, said "a long list of mistakes" had added to Morsy's unpopularity.
"He didn't do enough to build consensus among Egypt's very fractious forces and he had a style of government that wasn't inclusive," he told CNN.
But Hamid also highlighted the structural problems Morsy faced. "Anyone who was going to be president right now was going to deal with a deteriorating economy and a rotten, corrupt bureaucracy, many of whom are hostile to President Morsy and the Muslim Brotherhood," he said.
One example of that is the security sector, where a big chunk of the Interior Ministry didn't support him and then protested against him, he said.
"Part of it is Morsy's fault. But we can't lose sight of the bigger perspective, that Egypt is a very unwieldy country to govern and no one would have been able to make real improvements in the course of just one year."
After assuming office in June last year, Morsy took a number of steps that proved unpopular with certain sectors of Egyptian society.
In August, the president moved against the military leadership, sending into retirement Field Marshal Mohammed Hussein Tantawi, who, as chairman of the Supreme Council of the Armed Forces, had acted the country's de facto ruler in the wake of Mubarak's ouster and prior to Morsy's election.
A few months later, in November, he issued an edict declaring his decisions immune from judicial review until the holding of the constitutional referendum. He also sacked the head of the judiciary, many of whose members had remained loyal to Mubarak.
The opposition saw the moves as a grab for dictatorial powers and poured into the streets, converting Tahrir Square in central Cairo back into the center of public discontent it had been during the uprising that brought down Mubarak
In response, Morsy dropped his decree, but the situation remained tense. His supporters were accused of beating and detaining opposition protesters during deadly clashes near the presidential palace in Cairo in early December.
After a referendum in which more than 60% approved the new constitution, Morsy signed it into law in late December.
Critics argued it was passed too quickly, with liberals, Christians and other minority opposition groups saying they felt excluded from the Constituent Assembly that drafted it. Supporters hailed what they said was its protection of personal rights.
The international rights group Human Rights Watch said the constitution "protects some rights but undermines others," and that it "fails to end military trials of civilians or to protect freedom of expression and religion."
At the beginning of last month, the upper house and legislative power of parliament, the Shura Council, was invalidated by the country's highest court. Once a lower house is elected -- to replace the democratically elected parliament dissolved by the court last year -- the Islamist-dominated Shura Council will be dissolved.
New parliamentary elections are due later this year but Morsy has not yet set a date.
Morsy served as a central behind-the-scenes player for much of the decade before his election to the presidency, analysts say.
His official biography on the website of the Muslim Brotherhood-affiliated Freedom and Justice Party website describes him as "one of the most prominent political leadership figures of the Brotherhood, the organization that led the struggle against the ousted repressive regime in its last decade."
He led the Brotherhood's parliamentary bloc from 2000 to 2005 in addition to serving as president of the Department of Materials Science, Faculty of Engineering at Zagazig University.
Morsy was arrested several times under Mubarak's regime "due to his constantly firm stance against the repressive measures and oppressive practices of the overthrown regime," the party said. At one point, he spent seven months in jail.
Morsy told CNN's Christiane Amanpour during the election campaign that his party sought "an executive branch that represents the people's true will and implements their public interests."
He also said he would support democracy, women's rights and peaceful relations with Israel if he won.
He added, "There is no such thing called an Islamic democracy. There is democracy only. ... The people are the source of authority."
CNN's Josh Levs contributed to this report.