HARARE • Inside State House in Harare, Robert Mugabe was in the tightest spot of his 37-year rule.
Tanks were on the streets and troops had occupied the state broadcaster, from where the army had announced it had taken control of Zimbabwe.
Mugabe, 93 years old but still alert, remained defiant.
The only leader the country had known since independence was refusing to quit.
At a tense meeting with his military top brass on Nov 16, the world's oldest head of state put his foot down: "Bring me the Constitution and tell me what it says," he ordered military chief Constantino Chiwenga, according to two sources present. An aide brought a copy of the Constitution, which lays out that the president is commander-in-chief of the armed forces.
General Chiwenga hesitated before replying that Zimbabwe was facing a national crisis that demanded military intervention.
Mr Mugabe retorted that the army was the problem, according to the sources present. Then the beleaguered president indicated that perhaps they could find a solution together.
The meeting marked the start of an extraordinary five-day standoff.
The generals wanted Mr Mugabe to go, but they also wanted a peaceful "coup", one that would not irreparably tarnish the administration aiming to take over, according to multiple military and political sources.
The leader finally accepted defeat only after he was sacked by his own ZANU-PF party and faced the ignominy of impeachment. He signed a short letter of resignation that was read out to lawmakers on Nov 21.
To many, the end of Mr Mugabe had been unthinkable only one week before.
The army's action was the culmination of months of planning that stretched from Harare to Johannesburg to Beijing.
Drawing on a trove of intelligence documents from within Mr Mugabe's feared Central Intelligence Organisation (CIO), Reuters reported in September that the army was backing Emmerson Mnangagwa, then vice-president, to succeed Mr Mugabe when the time came.
The report detailed how Mr Mnangagwa, a former security chief of Mr Mugabe, might cooperate with Mr Mugabe's political foes in order to revive the economy. It caused furore in Zimbabwe's media and political circles. Bitter rivalry intensified between Mr Mnangagwa and Grace, Mr Mugabe's 52-year-old wife.
Mr Mugabe also became increasingly paranoid about the loyalty of army chief General Chiwenga, a career soldier and decorated veteran of Zimbabwe's 1970s bush war against white-minority rule.
Mr Mugabe's spies were warning him the military would not accept Grace as president. "Mugabe was openly told by senior CIOs that the military is not going to easily accept the appointment of Grace. He was warned to be ready for civil war."
After a tense meeting between Mr Mugabe and General Chiwenga on Nov 5, the military chief flew to China, which wields significant influence as a major investor in Zimbabwe. A day later, Mr Mugabe sacked Mr Mnangagwa as vice president and purged him from ZANU-PF.
An intelligence report, dated Oct 30, said Beijing and Moscow both supported regime change out of frustration at Zimbabwe's economic implosion under Mr Mugabe. "China and Russia are after change," the report said. "They are after change within ZANU-PF as they are sick and tired of Mugabe's leadership."
General Chiwenga later returned to Zimbabwe, and put into motion moves to oust Mr Mugabe, including putting out six armoured personnel carriers headed to capital Harare.
Mr Mugabe in his letter of resignation said he was stepping down out of "concern for the welfare of the people of Zimbabwe".