Rebels have controlled half of Ivory Coast for the past seven months.
A peace deal brokered by France in January led to a new "government of unity" including representatives from rebel factions.
Yet fighting continued in the west of the country where the presence of Liberian fighters has complicated the situation.
But a "full" ceasefire has now been signed between the warring parties who have also agreed on a joint plan to push Liberian soldiers out of Ivory Coast.
BBC News Online looks at the reasons behind the conflict and whether peace and prosperity can return.
What is in the new accord?
The army chief of staff General Mathias Doue and top rebel commander Michel Gueu have agreed to a "total" ceasefire.
The government had previously agreed a ceasefire with the main MPCI rebel faction, which holds the northern half of the country.
However the latest agreement encompasses the entire country, including the west where fighting has been continuing.
The army and rebel factions have also agreed to carry out a joint operation with 900 French soldiers to clear western areas of Liberian fighters who are accused of looting and generally destabilising the situation.
The new ceasefire provides for the disarmament of mercenaries and armed groups operating on both sides.
Why did fighting break out?
The uprising began on 19 September 2002 with a mutiny by troops unhappy at being demobilised.
But it quickly turned into a full-scale rebellion, voicing the unhappiness of northern Muslims at what they saw as discrimination by the government of President Laurent Gbagbo.
Opposition leader Alassane Ouattara, a northern Muslim, was barred from standing in presidential elections because of a new law which said that presidential candidates must be born in Ivory Coast and both parents must be Ivorian.
He was accused of being from Burkina Faso, even though he had previously been prime minister of Ivory Coast.
For some Muslims, this symbolised their marginalisation.
Why was the law changed?
Because of fears of being "swamped" by immigrants.
Ivory Coast used to be West Africa's richest country. It is the world's largest producer of cocoa, the raw ingredient of chocolate.
During the time of President Felix Houphouet-Boigny, immigrants from its poorer neighbours were encouraged to do the dirty work in Ivory Coast.
Foreigners, mainly from Burkina Faso and Mali, are estimated to count for a third of the population.
In the 1990s, the economy started to go downhill and Ivorians began to resent such a large foreign presence.
It was then that President Henri Konan Bedie introduced the concept of "Ivoirite", or Ivorianness.
Why does Ivory Coast matter?
Neighbours Burkina Faso and Liberia have been accused of backing the rebellion.
They have denied this but it raises the nightmare scenario of other countries being dragged into the conflict.
There have been several xenophobic attacks on Muslims and foreigners in government-controlled areas.
Since the conflict began, many thousands of these African expatriate workers have returned to their home countries.
This has already hurt the whole region as poor countries lose valuable remittance earnings.
Most French-speaking West African countries share the same currency, the CFA franc, and instability in Ivory Coast has hit investment and confidence across the region.
What is the French interest?
France is the former colonial power and has had a military base in Abidjan since the 1960s.
France guarantees the CFA franc and its businesses still dominate the economy.
Until anti-French protests led Paris to urge "non-essential" citizens to leave, there were 16,000 French nationals in Ivory Coast.
French troops have also been monitoring a ceasefire line across the middle of the country.
This is why France was so determined to push all the sides together and get them to agree to end the fighting and form a national unity government.
Why the anti-French feeling?
Because of the peace deal brokered by the French.
Rebels say they were promised the key defence and interior ministries under a power-sharing agreement, although this does not appear in the official text.
Supporters of Mr Gbagbo in the commercial capital, Abidjan, accuse the French of forcing him to sign this deal.
Since the conflict broke out, Mr Gbagbo has said the French army should have intervened to protect him, as a democratically elected leader.
So what happens next?
If all sides cannot make the power-sharing government work, then there could be a return to fighting - especially if French troops are switched away from manning the buffer zone.
One key thing to look out for is whether the neutral prime minister Seydou Diarra remains in his post.
If he resigns, then the prospect of differences being resolved through talking recedes.
And even if things go well, it is likely to be some time before the rebels feel they can hand in their weapons.