CAIRO When President Mohamed Mursi swept aside the ageing commanders of Egypt's military a year ago and named a soft-spoken, deeply religious younger general to head the armed forces, it was a demonstration that the military was now subordinate to Egypt's first freely elected leader.
Fast forward one year, and now it is the general, Abdel Fattah al-Sisi, who appears poised to sweep aside the president.
At the time of his appointment last August, the choice of Sisi, 58, seemed to suit both Mursi and the younger generation of army commanders seeking promotion after years under older generals, like 78-year-old Field Marshal Hussein Tantawi, Mubarak's defence minister for two decades.
The army had produced the autocrats that had ruled Egypt for the previous 60 years. It had run the country itself during the tumultuous 16 months after the revolution that toppled the last general to serve as president, Hosni Mubarak.
And it had seemed reluctant to hand power to Mursi until the new president briskly dispatched Tantawi and a host of other commanders into retirement.
Egyptians wanted their soldiers back in barracks, and the charismatic, chisel-jawed Sisi spoke like a man who would keep them there. Over the course of the next year, Sisi warned of unrest and political divisions, but repeatedly held firm in asserting that the army should not return to politics.
"The armed forces' loyalty is to the people and the nation," Sisi said in November when Mursi's supporters and opponents clashed on the streets over plans to introduce a new constitution.
Sisi finally ditched his refusal to pick sides on Monday, announcing a dramatic ultimatum that gave Mursi, the man who had chosen him, just 48 hours to agree on a power-sharing deal with his rivals.
ISLAM AND UNCLE SAM
A career military man, Sisi was groomed for a leadership role after serving in top roles in the command, intelligence and diplomatic branches of the armed forces.
Among his previous postings were a stint as defence attaché in Riyadh, Saudi Arabia, and command positions in the Sinai Peninsula which borders Israel and in the Northern Military Region which includes the second city of Alexandria.
"He had been carefully prepared for a high command position," said Robert Springborg, an expert on the Egyptian military based at the Naval Postgraduate School in Monterey, California.
Apart from his comparative youth among top ranking commanders, two other attributes made him a good fit for the Islamist Mursi seeking a new generation of military leaders.
In a military known for its secularism, Sisi is a devout Muslim, whose wife is said to wear the niqab full-body covering. And after a year at the U.S. Army War College in Pennsylvania in 2005-2006, he was comfortable with the United States, which funds Egypt's military with $1.3 billion a year.
"Insiders in the U.S. government and military were aware of him. He was a name that was mentioned when people talked about next generations," said Springborg.
He had a favourable reputation among those who worked with him in the American military, although his course work was described as showing Islamist leanings, Springborg said.
"Islamic ideology penetrates Sisi's thinking about political and security matters," he said, citing material Sisi produced while at the course.
Steve Gerras, a retired Army colonel who was Sisi's faculty adviser at the college, described him to Reuters as a serious student and pious Muslim, open to the United States and passionate about Egypt's future.
"He was a serious guy. He is not a guy who would go to a standup comedy show. But at the same time he would stop by - I mean every week ... His eyes were always very warm. His tone was very warm."
Some liberals were initially wary of Sisi, especially after remarks he made defending the army's practice - later disavowed - of conducting "virginity tests" on female protesters who complained of abuse.
Nevertheless, the army under Sisi has continued to enjoy widespread support in the country, arguably the only institution that has such favour.
According to a Zogby poll published last month, the army as an institution scored a 94-percent confidence level. About 60 percent of non-Islamists favoured a temporary return to army rule, while almost all Islamists opposed that.
Sisi has carefully nurtured public support for the army in recent days, sending aircraft to drop thousands of Egyptian flags on crowds of cheering protesters in Cairo's Tahrir Square.
The army's dramatic re-entry into politics was not inevitable, said Michael Wahid Hanna of the New York-based Century Foundation.
The army was not angling to get back in and rule, and Sisi in particular was not among the minority of hawks within the army leadership keen on reasserting such a role, Hanna said.
Egyptian military sources say Mursi's call last month for foreign intervention in Syria was a turning point. Mursi's Brotherhood went further, backing calls for holy war, rhetoric that alarmed a military that had spent decades hunting down radical militants.
"This doesn't mean that Sisi gives up on the idea that Islam should be a very important consideration in Egyptian national security policy, but this is not the way it's done," said Springborg said.
"It means he looks at the world from an Islamist framework so he would not want the whole project of Islamism to be destroyed and that's what is now in the offing because the Brotherhood has so mishandled things - Sisi probably feels to some extent betrayed by Mursi and the Brothers who have mishandled things so badly."