LIBREVILLE, Gabon (AP) -- Central African Republic President Francois Bozize and the rebels who sought to overthrow him have reached a deal that will allow him to stay in office until his term ends in 2016, officials said Friday.
The announcement came after several days of peace talks in Gabon, which were organized after an alliance of rebels groups swept through the north of the country and seized control of a dozen towns.
On Friday, Bozize publicly shook hands with the rebel representatives -- whom he had denounced as terrorists just two days before -- and other political opponents to seal the deal that spares his ouster.
The rebel offensive stopped short of the capital of Bangui but posed the gravest threat to Bozize during his nearly 10 years in power.
"The president, backed into a corner, was forced to make a number of concessions and to make true of his promise to encourage a government of national unity," Margaret Vogt, U.N. special envoy to Central African Republic, told the U.N. Security Council by videoconference from Libreville, Gabon.
Bozize said he would move to dissolve the government Saturday so that a national unity government could be formed that would be led by a prime minister chosen by the political opposition.
"For me, it's a victory for peace because from now on Central Africans in conflict zones will be finally freed from their suffering," Bozize said upon arriving at the airport back in Bangui. "I ask everyone to stay calm. As for me, I still remain the president of Central African Republic."
News of the agreement, which includes a cease-fire, was met with relief on the streets of Bangui, the capital of Central African Republic.
"This agreement could help to calm the anxiety of people who are truly afraid," said Albert Mbaya, 40, a philosophy professor in Bangui.
While Friday's agreement appears to suggest a swift resolution to the rapidly advancing rebellion, it still remains to be seen whether forces on the ground will abide by the deals reached in Gabon.
Seleka, which means alliance in the local Sango language, is made up of four separate groups -- some of whom have previously fought one another.
Friday's announcement also does not explicitly address some of the broader grievances raised by the rebels, including aid to the deeply impoverished north of Central African Republic.
The fighters, who began their collective offensive on Dec. 10, had previously called for Bozize to step down from power and had dismissed his calls to form a national unity government.
Under the deal announced Friday, neither the prime minister nor the president would be eligible to take part in the next presidential election, Vogt said.
Friday's agreement also includes a provision that legislative elections will be organized in a year, according to a statement read by Chadian Foreign Affairs Minister Moussa Faki Mahamat.
"The mandate of President Bozize is a constitutional question. We cannot challenge the Central African Republic's constitution," said Chadian President Idriss Deby, who presided over the closing ceremony for the talks.
Bozize seized power in 2003 after a rebellion, and later went on to win elections in 2005 and 2011, though the United States and others have described the votes as deeply flawed.
His government gained support earlier this month when militaries from neighboring countries Chad, Gabon, Republic of Congo and Cameroon all sent forces to help stabilize Central African Republic. Additionally, South Africa also has sent military aid.
Despite Central African Republic's wealth of gold, diamonds, timber and uranium, the government remains perpetually cash-strapped. The land-locked nation of 4.4 million, a former French colony, is among the poorest countries in the world.
Larson reported from Dakar, Senegal. Associated Press writers Hippolyte Marboua in Bangui, Central African Republic and Edith M. Lederer at the United Nations contributed to this report.
Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.