Editor's Note: Richard Downie is the Deputy Director of the Africa Program at the Center for Strategic and International Studies.

By Richard Downie, Special to CNN

The protracted election crisis in Ivory Coast has taken a decisive turn. Armed forces professing loyalty to the winner of November’s presidential election, Alassane Ouattara, made their move following months of deadlock caused by the incumbent Laurent Gbagbo’s refusal to leave office.

Christened the Republican Forces of Ivory Coast (FRCI) by Ouattara, they swept south from their northern base, capturing most of the country in a matter of days. The offensive did not meet serious resistance until it reached Ivory Coast’s largest city, Abidjan, a stronghold of Gbagbo support.

Heavy fighting took place over five days between the FRCI and Gbagbo’s presidential guard and youth militia. Gbagbo’s resistance finally cracked on April 5, when his presidential palace was overrun. He is now thought to be negotiating the terms of his surrender.

How did we get to this point?

To a large extent, this is the story of one man’s stubborn refusal to accept the verdict of his own people, who voted him out of office in a free and fair election. Ivory Coast has been embroiled in a long-running crisis which goes back to a civil war in 2002, which left the country divided in two - north and south - with Gbagbo at the helm of a power-sharing government.

A tortuous peace process dragged on for several years, the ultimate goal of which was to hold elections that would reunite the country. Gbagbo stalled these elections for five years. They were eventually held last November amid a sense of hope that Ivory Coast’s troubles might finally be coming to an end. Not so.

Gbagbo unequivocally lost a run-off vote to Alassane Ouattara but decided to ignore the result and had himself sworn in as president. Ouattara, confined to a hotel, set up an alternative government, and the stalemate began.

What seems to have broken the deadlock?

Ouattara’s supporters ultimately forced the issue by resorting to military might, having become exasperated by Gbagbo’s intransigence and the failure of international diplomats to resolve the crisis. Their rapid advance was aided by the refusal of most of Gbagbo’s formal army to fight for him. Gbagbo loyalists did however make a final stand in Abidjan.

Media access to the city has been limited but it is feared that serious loss of life may have occurred. Many civilians have been caught up in the fighting and more than one million are thought to have fled their homes from Abidjan alone.

The United Nations appears to have played a crucial – and controversial – role in settling this crisis. What happened?

The United Nations Operation in Ivory Coast (UNOCI) has been on the ground since 2004 tasked with monitoring the ceasefire which ended Ivory Coast’s 2002 civil war. It is supported by a contingent of 1,600 French troops. The 10,000-strong UNOCI force has a chapter VII mandate, allowing it to use force in self-defense or in order to protect civilians.

For much of the election crisis, UNOCI stood back while pro-Gbagbo militias took potshots at its forces on an almost daily basis. But as the battle for Abidjan intensified, they took decisive action on April 4-5.

UNOCI and French attack helicopters fired on Gbagbo’s military bases, as well as combat vehicles and an ammunition depot. The justification was that they were responding to the repeated targeting of civilians and their own peacekeepers by heavy weapons fire.

But some have argued that the operation breached the UN commitment to neutrality. Indeed, the attacks appeared to have helped turn the battle for Abidjan in favor of Ouattara’s forces. Russia’s foreign minister, Sergei Lavrov, is among those who have accused the UN and France of taking sides in the conflict.

Where does Ivory Coast go from here? What lies in store for Gbagbo and president-elect Ouattara?

By holding out for so long, Gbagbo has lost any right to negotiate the terms of his exit. In an ideal scenario, he should prepare for a trip to the International Criminal Court, whose prosecutors have been closely monitoring events in Ivory Coast. It remains to be seen whether another African country might help him escape this fate by offering him a quiet exile.

President Ouattara faces the formidable challenge of healing a deeply divided country in which a sizeable minority openly questions his right to govern. Having been denied his right to win control of the country through the ballot box, he has ultimately claimed it by force.

The heavy fighting of the past few days has led to excesses by both sides in the conflict. The FRCI has been accused by the International Committee of the Red Cross of being involved in a massacre in the town of Duékoué, although Ouattara strongly denies this claim.

In addition, the incoming president will inevitably face the politically damaging claim that he was propelled to power by the French, Ivory Coast’s former colonial masters.

All of these factors dent Ouattara’s credibility. For these reasons, his main priority upon taking office will be to promote national reconciliation. Ouattara will need to act with restraint towards those who opposed him and would be advised to reach out to his erstwhile enemies by including some of the more moderate Gbagbo loyalists in his government.

There remains cause for hope despite the challenges. Ivoirian political leaders have shown an impressive capacity to patch up their differences in the past; those skills will be needed again in the coming weeks and months.

Why does a resolution of this crisis matter to the United States?

Gbagbo’s stubborn refusal to leave office has been a very public repudiation of the Obama administration’s number one policy priority in Africa: promoting good governance and democracy.

Gbagbo’s actions set a terrible example in a continent where in 2011 alone, 27 major elections are being contested. They include crucial polls in some key U.S. allies, including Nigeria, Africa’s largest democracy and a bellwether of stability in the region.

The electoral crisis in Ivory Coast shines a light on the faltering course of democratization in Africa and is only the most blatant example of a worrying trend whereby losing candidates challenge results in the hope of bargaining for a share of the power.

So far this year, there have been acrimonious outcomes to elections in Benin, the Central African Republic, and Uganda, and it is becoming almost the default option for losing candidates to cry foul play. In many countries they have legitimate grievances, but at the same time their claims tend to damage the integrity of the electoral process. Gbagbo’s complaints, however, did not have a shred of legitimacy and it is for this reason that the United States has been so forthright in insisting that he step aside.

For more from CSIS on the crisis in Ivory Coast, click here.

The views expressed in this article are solely those of Richard Downie.