Laurent Gbagbo is holed up in his official residence, surrounded by forces loyal to his rival in Ivory Coast's main city, Abidjan. He was said to have been on the verge of surrender earlier this week but is still hanging on and BBC Afrique editor Mahamat Adamou says he is not about to go quietly.
Laurent Gbagbo is playing the long game, as he believes that time is on his side.
Although his situation looks precarious, he thinks he can outlast the forces of Alassane Ouattara, widely recognised as the winner of last November's election, as well as those of France and the UN who are helping him.
Mr Gbagbo is relatively safe inside the fortified building, which he has had four months to stock up in case of a siege.
He is hoping that if the siege lasts much longer, he can whip up nationalist sentiment against the involvement of former colonial power, France, against him.
The other reason why he has not given up hope of staying in office is that any transfer of power must be done according to the constitution.
In his eyes, he has been legally sworn in as the re-elected president.
As long as he does not renounce that position, whatever happens to him, there will be doubts about the validity of Mr Ouattara's claims to be president.
Whatever the UN may say about who won the election, Mr Gbagbo's allies constantly point out that Ivory Coast is a sovereign state, not a UN protectorate.
Last stand in Abidjan
Mr Gbagbo spent much of his life fighting for democracy against the one-party state of Ivory Coast's founding President Felix Houphouet-Boigny.
He organised street protests and was jailed - while Mr Ouattara was Mr Houphouet-Boigny's prime minister.
Although the UN mission in Ivory Coast, which helped organise the vote, says Mr Ouattara won, Mr Gbagbo argues that the former rebels who controlled the north during the election rigged the vote in those areas in favour of Mr Ouattara.
The Constitutional Council - the body which certifies election results - agrees with Mr Gbagbo, although his critics point out that it is run by one of his allies.
The UN says it found no evidence of rigging in the north but Mr Gbagbo says France is manipulating the international body, as it seeks to reassert its economic dominance of the world's largest cocoa producer, previously one of the richest countries in West Africa.
His critics say he is now on the wrong side of the fight for democracy but he vehemently denies this.
He accuses Mr Ouattara of seeking to take power by fomenting a rebellion in 2002 and when this was blocked, trying to come to power by rigging these elections.
Mr Ouattara has always denied the accusations of links to the rebels, but it is those fighters who have now marched through the country to Abidjan in the past fortnight, and surrounded Mr Gbagbo with the aim of installing Mr Ouattara in the presidential palace.
Those forces met hardly any resistance as they advanced on Ivory Coast's main city and experts confidently predicted that Mr Gbagbo's demise was imminent.
But his strategy was to withdraw his forces to his stronghold in Abidjan for the last stand we are currently witnessing.
Although many of his senior army commanders have defected, he can still count on the loyalty of some troops, as well as thousands of his young supporters, who have been given weapons in recent weeks.
In military terms, Mr Gbagbo thinks it is only the firepower and air superiority of the UN and French forces which could tip the balance in favour of his rival.
And although the air strikes did destroy some of his heavy weapons, they have not yet managed to dislodge him.
This, of course, fits perfectly into Mr Gbagbo's view of himself as a national champion taking on the might of the world.
Death no release
But even if Mr Gbagbo cannot fight his way out, he is also confident that he could outlast his rivals in a siege.
In a previous confrontation with the French military, his supporters said Ivory Coast would be "France's Vietnam".
They do not think that France or the UN have the appetite for a long, drawn-out military involvement in West Africa.
Mr Gbagbo also knows that the bulk of the pro-Ouattara forces are from the north of the country, while a majority of Abidjan's residents support him.
Their supply lines have been stretched by their recent advance and there have been numerous reports of the former rebels resorting to looting in order to feed themselves.
Although Mr Ouattara has urged them to stop, they are not all disciplined forces - some are members of ethnic militias and traditional hunters.
The longer the deadlock continues, the more Mr Gbagbo will try to portray it as a fight between "true Ivorians" and a foreign-backed force.
If he can turn the tide of public opinion in Ivory Coast and even the whole of Africa against Western meddling in Africa's affairs, he thinks the forces lined up against him could start to lose their stomach for a fight.
Countries including South Africa and Russia, both on the UN Security Council, have already criticised the UN air strikes, saying that was not part of the resolution they voted for.
However, the West African regional body, Ecowas, and the African Union have so far resisted Mr Gbagbo's attempts to portray himself as an African hero fighting neo-colonial forces.
The other plank of his survival strategy is based on the law.
As long as he does not sign a document recognising Mr Ouattara as the rightful election winner, there is a legal vacuum.
The constitution says that if the president resigns or dies in office, the speaker of the national assembly should replace him.
For Mr Ouattara to be recognised as the legitimate president, he must be so proclaimed by the Constitutional Council.
And until this happens, Mr Gbagbo will try to hang on to whatever power he still enjoys.
Even his death would not solve the problem for Mr Ouattara - and his forces have been at pains to say they want to capture Mr Gbagbo alive.
"I am not a kamikaze, I love life," he said in his most recent interview.
"My voice is not the voice of a martyr. I am not seeking death but if death comes, it comes."
Although he says he does not want to be a martyr, this history professor knows that his death would make life even more difficult for the man he has spent much of his life trying to keep out of power.