The nightmare in Ivory Coast has ended. Former history teacher President Laurent Gbagbo will soon be history.

“All the generals who are fighting for Gbagbo have deserted him; the war is over,” the UN’s special envoy in Ivory Coast YJ Choi told Al Jazeera last night. “There is no army, there is no fighting.”

As darkness fell in Abidjan, Gbagbo was hiding in a bunker in the basement of his villa, surrounded by forces loyal to the newly elected president Alassane Ouattara.

Three of his generals were reported to be negotiating his surrender and exit.

“I am not a kamikaze,” Gbagbo told French TV channel LCI in an exclusive telephone interview from his bunker, “I love life. I do not wish for death.”

In the 20-minute interview, Gbagbo blamed the French for declaring war on Ivory Coast and engineering a coup against him. French attacks on his military camp in Abidjan on Monday destroyed his army’s weapons and ammunition, he said.

Gbagbo is certain to seek safe passage out of the country, and may well end up in Angola or Ghana. But he’s not got much bargaining power now that his soldiers have given up the fight.

In these circumstances, it would be amazing (and appalling) if he were promised immunity from prosecution, or allowed to go to a country that won’t hand him over to the International Criminal Court, which will soon be after him.

Earlier this week, a spokesman for Alassane Ouattara promised the BBC that Gbagbo would be “brought to justice”. And Ouattara himself pledged to punish those responsible for the brutal massacres in Duekoue, where at least 800 people are believed to have died.

But Gbagbo has more blood on his hands: the strongman’s refusal to go after losing last November’s election put Ivory Coast through five months of terror, in which at least 1000 people lost their lives and 1 million refugees fled their homes.

Last night the situation in Abidjan was still “alarming”, according to the UN, which said, “Most of the hospitals are not functioning and ambulances have been fired on when they tried to enter the city.” In Dekoue, civilians were still “fearful and traumatised”.

The situation will remain “very messy” in the short term, according to Hannah Koep, Ivory Coast analyst for consultancy Control Risks.  “Gbagbo’s supporters are still very heavily armed and they will be very frustrated. The security situation in Abidjan is likely to be very unpredictable for some time to come. Beyond that, the challenges are monumental.”

Ivory Coast has been split by civil war for nine years and divided by conflict between north and south for more like 20 years. But there may also be tensions within the new government, which is dominated by two powerful — but very different — politicians.

The new president, Alassane Ouattara, is a 69-year-old US-educated economist with a French wife, who has spent most of his time working abroad. A former deputy managing director of the IMF, he is seen by some as too Western and a foreigner (his mother was born in Burkina Faso). He is also a Muslim, while many southerners in Ivory Coast are Christian.

The new Prime Minister, Guillaume Soro, looks both far more radical and ambitious. A former student leader who led an attempted coup in 2002, Soro commands the rebel forces that took Abidjan, and he has long controlled the north of the country. Yet he also served as Prime Minister in Laurent Gbagbo’s government until 2007 and was expected to support Gbagbo in the 2010 election.

Ouattara would do well to watch him.