After nine days of negotiations, Ivory Coast's warring factions announced a deal this morning to end a conflict between the government and three rebel groups that has claimed hundreds of lives since erupting five months ago.

The peace plan, hammered out by representatives of the government, the rebels and Ivorian political parties at a stadium outside Paris, calls for President Laurent Gbagbo to remain in office. The rebel groups all had demanded that Gbagbo step down, but the accord instead requires that he share power with a prime minister acceptable to all factions until new elections can be held.

All sides, including the government, agreed to lay down their weapons simultaneously -- a demand that had been resisted by Gbagbo, who asserted that his troops were entitled to defend the country from the rebels. In addition, the rebels will be granted amnesty.

Gbagbo, who did not attend the talks, arrived here today for a weekend summit of West African leaders who are to ratify the peace pact. He met with President Jacques Chirac but made no public comment about the accord.

French officials were cautious but hopeful that today's agreement would restore order in a country once described as the showcase among France's former colonies in Africa. "We have high hopes this evening that the weekend summit will complete the process of national reconciliation," a Chirac spokeswoman said.

The war broke out on Sept. 19, when mutinous soldiers attempted to topple Gbagbo. Though they failed, they seized control of the northern half of the country, where the largely Muslim population had grown resentful of what it perceived as domination by southerners, including the country's leaders.

After a month of fighting, the northern rebels, who call themselves the Patriotic Movement of Ivory Coast, and Gbagbo's government agreed to a cease-fire. But fighting soon erupted in the west, where two new rebels groups -- the Movement for Justice and Peace and the Ivorian Patriotic Movement of the Great West -- took up arms. Analysts and government officials have said the western rebels have employed guerrillas from neighboring Liberia in their campaign against the government, which has used foreign mercenaries on its side.

Further complicating the conflict is the presence of some 2,500 French troops, sent to enforce the cease-fire and ensure the safety of the 20,000 French citizens in Ivory Coast. The French have come under criticism from both sides, with Gbagbo saying they should do more to help support a recognized government and the rebels accusing them of allowing numerous cease-fire violations by government forces and mercenaries.

The peace talks brought together not only the government and the three rebel factions but also representatives of the Democratic Party of former president Henri Konan Bedie and the Rally of the Republicans, the party of the exiled former prime minister, Alassane Ouattara.

The contentious next step will be naming a new prime minister. The agreement says only that the prime minister will be chosen by a consensus of the factions, but an Ivorian source close to the talks said tonight, "Right now, everyone has his own candidate."

The agreement also limits the president to two five-year terms, and it calls on the government to set an early date for "credible and transparent elections."

President Laurent Gbagbo, left, met with French President Jacques Chirac in Paris but did not attend the nearby peace talks or comment on the accord.