Ivory Coast, previously West Africa's richest country, has been divided between north and south - between rebels and the national army - since September 2002.
Security forces killed opposition supporters last March, the UN says
The two sides have agreed a peace deal leading to elections but many obstacles remain before the country can be reunited.
What was the conflict about?
The rebel New Forces accuse successive governments of discriminating against northern Muslims and those of foreign origin.
It was difficult for those with foreign roots to acquire nationality and own land, while candidates in presidential elections had to show that both their parents were Ivorian nationals.
Rebels tried to overthrow President Laurent Gbagbo in September 2002, they took the Muslim north but French troops stopped them from reaching the main city, Abidjan.
Since then the situation has generally been a stand-off, rather than outright conflict.
Are there a lot of foreigners in Ivory Coast?
Ivory Coast, as the world's largest producer of cocoa, used to be West Africa's richest country.
It was a magnet for millions of immigrants from poorer neighbours, especially Burkina Faso and Mali, who worked in the cocoa fields.
But in the 1990s, the economy started to go downhill and Ivorians began to resent such a large foreign presence, which accounted for up to a third of the population.
It was then that former President Henri Konan Bedie introduced the concept of "Ivoirite", or Ivorianness.
This prevented opposition leader Alassane Ouattara, a former prime minister, from contesting presidential elections, on the grounds that his family originally came from Burkina Faso.
Many northern Muslims have family ties across the borders and saw this as a sign of their marginalisation.
What does the latest peace accord involve?
In the deal, reached in Burkina Faso on 4 March 2007 after four weeks of talks, the government and the New Forces agreed to form a new power-sharing government within five weeks. It is not clear who will be prime minister.
They also set a timetable for disarmament and agreed to establish a joint army command.
The buffer zone between the two sides - known as the confidence zone - is to be removed. It is currently patrolled by 10,000 French and UN troops.
The deal also paves the way for elections, expected within 10 months.
Haven't we heard that before?
Yes, the two sides have a history of signing power-sharing agreements that break down amid mutual recrimination.
However this time, observers note that the deal was negotiated and signed by the two top leaders,
Mr Gbagbo and New Forces leader Guillaume Soro - which gives ground for cautious optimism.
What happened to the previous accords?
The power-sharing "government of unity" outlined in the January 2003 peace agreement brokered by France never lived up to its name.
In protest at the killing of 120 people during a banned opposition march in Abidjan, the New Forces and Mr Ouattara's Rally of the Republicans withdrew in March 2004.
A UN report said the security forces had singled out suspected opposition supporters - Muslims and foreigners - to be killed.
The boycotters rejoined the government following a new peace agreement reached in July 2004 with West African leaders.
Under this deal, new laws making it easier for those of foreign origin to get Ivorian citizenship and run for the presidency were to be introduced by the end of September, with disarmament to follow two weeks later.
The laws were eventually passed but the rebels said they had been watered down so much it made no difference, and so they refused to disarm.
However, after a South African-brokered deal, Mr Gbagbo agreed to overrule the constitution and let Mr Ouattara contest elections.
This has long been a key rebel demand and seemed to move things on.
Has there been much fighting?
The north-south split has hardly changed since the conflict began in 2002.
In November 2004, the army bombed the rebel stronghold of Bouake but also killed nine French peacekeepers.
The French retaliated by destroying the Ivorian air force, sparking anti-French riots in Abidjan.
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 French 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.
Gbagbo said the French should have supported him
France has 4,000 troops monitoring a buffer zone between the rebel-held north and the loyalist south, along with 6,000 UN peacekeepers.
However, there is widespread anti-French feeling.
Anti-French protests have been fomented by state media, which backs the president.
The Ivorian army accused French troops of acting like an invading force as they patrolled with tanks in an attempt to impose calm on the city and protect their own citizens.
If the buffer zone disappears, as the latest deal specifies, what would foreign troops do?
They would leave. The French say they are ready to pull out their forces immediately.