CAIRO In the end, the army sided with the protesters and the cruel joke was on the president: whether it was tragedy or comedy, placards reading "Egypt and Mursi don't mix" got the biggest laugh on Tahrir Square.
The armed forces overthrew President Mohamed Mursi on Wednesday, declaring that he had "failed" the Egyptian people.
A poor farm boy from the Nile Delta, made good through an American education and pious loyalty to the underground Muslim Brotherhood, Mursi was shoved blinking from obscurity a year ago to become Egypt's first freely elected president.
Taking on a role that the Brotherhood had feared might be a trap sprung by a hostile bureaucracy inherited from the old regime, Mursi's personal ratings were sapped by an economy in free fall and one clumsy policy move after another.
He was fatally undermined by his failure to shake a conviction among the talkative urban elites that he was the clownish pawn of a secret society of religious zealots.
When, in January, he ventured a few words in English during a visit to Germany, he presented himself as a perfect fall-guy for a new breed of political comic wowing television audiences with the freedoms won in the revolution on Tahrir two years ago.
"Gas and alcohol don't mix," the teetotal Muslim engineer told a bemused Berlin audience, his English stilted and tapping the table for emphasis to make a point about road safety.
The clip, as mocked by a satirist on prime-time TV, went viral on social media among Egypt's anglophone liberal elite. When the show's host Bassem Youssef, who revels in being "Egypt's Jon Stewart", was hauled in for questioning for insulting the president, the joke just grew.
When someone first wrote "Egypt and Mursi don't mix!" on a placard, the slogan took off; soon millions were in the streets and a beleaguered Mursi was left fuming in rambling speeches about the personal iniquities heaped on him by the media.
Samer Shehata, an expert on Islamist Arab politics at Oklahoma University, summed up the dilemma Mursi's fate has exposed in Egypt, where liberals are celebrating the military toppling a democratically elected leader: "Its politics are dominated by democrats who are not liberals and liberals who are not democrats," Shehata wrote in the New York Times.
Mursi and his allies in the Brotherhood's Guidance Council - Egypt's liberals called them his puppeteers - also made mistakes: "He has been a disastrous leader," Shehata said. "Divisive, incompetent, heavy-handed and deaf to wide segments of Egyptian society who do not share his Islamist vision."
Broken promises on the economy in particular, where people have suffered shrinking real incomes and lengthening lines for fuel, widened the appeal of a protest movement rooted in a liberal opposition that repeatedly lost elections to Islamists.
"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.
Highlighting the "media warfare", he added: "He was fighting on many fronts at the same time and that is always a very bad political tactic. He united the opposition against him."
As hopes for consensus faded, Mursi ploughed on regardless, casting his opponents as bad losers who spurned his outstretched hand. His allies, meanwhile, were whittled down to Islamists at the extreme religious right.
Mursi defended his legitimacy as an elected leader in a keynote speech last week before an invited audience of cheering supporters, after a first warning from the army to embrace his opponents. Broadcast live on national television for nearly three hours, it was a mark of a stubborn failure to understand how to communicate beyond the Brotherhood's electoral base.
"He knows his primary audience is not opposition supporters or secular-minded urbanites," the International Crisis Group's Yasser El-Shimy said of Mursi's attempt at a new, folksy style.
Mursi, 61, is a civil engineer and lecturer with a doctorate from the University of Southern California. He was raised in a poor farming village a two-hour drive north of Cairo.
Thrust into the presidential race when the Brotherhood's first-choice candidate was disqualified, he was dismissed at first as the "spare tyre" but did in time grow in confidence.
The novice president stunned Egyptians in August when he sacked Hosni Mubarak's defence minister, a move that drew grudging respect from some critics, even in the liberal camp.
Visits to China and Iran set a new tone for Egypt's foreign policy. Brokering an end to a short war between Israel and the Palestinian group Hamas won him kudos from Washington and reassured the West that Islamist rule would not end a regional order underpinned by Egypt's 1979 peace treaty with Israel.
Yet no sooner had Mursi helped settle that international conflict than he set off another one at home. A decree allowed the Islamists to complete a constitution free of the risk of legal challenges. Mursi then put the controversial text to referendum, ignoring violent protests. He won, but at a high cost.
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.
Worried about alienating hardliners with his outreach to Shi'ite Iran, last month he joined a gathering of sectarian Sunni radicals calling for holy war in Syria - a move that may have fatally undermined the loyalty of Abdel Fattah al-Sisi, the pious, U.S.-trained general Mursi made head of the armed forces.
Adventurism abroad and economic mismanagement at home fueled opposition with the military and the wider public, said Imad El-Anis, at Nottingham Trent University. But, most importantly, Mursi "understood democracy as only being about elections".
He simply ignored tens of millions who did not vote for him.
This week, General Sisi listened to them and agreed with the jokers. Mursi and Egypt simply did not mix, he decreed.
(Editing by Peter Graff and Giles Elgood)