Abidjan, Ivory Coast (CNN) -- Two candidates. Two councils. Two winners. Add it up and it bodes for a mess in the already unstable West African nation of Ivory Coast.
Tensions rose Friday as the Constitutional Council declared incumbent Laurent Gbagbo the winner of last Sunday's presidential runoff.
That conclusion contradicted results that had been reported Thursday by the Independent Electoral Commission. The electoral panel had named Gbagbo's rival, former Prime Minister Alassane Ouattara, the winner. The United States and the United Nations had extended their congratulations to the opposition candidate.
But on Friday, Paul Yao N'Dre, the Constitutional Council president, told reporters that after tossing out votes in seven regions that were marred by irregularities, Gbagbo had won with slightly more than 51% of the vote to Ouattara's 48%.
Both candidates alleged fraud. Both claimed victory.
In a written statement, U.S. President Barack Obama congratulated Ouattara, saying "the United Nations have all confirmed this result and attested to its credibility."
He warned Gbagbo, "The international community will hold those who act to thwart the democratic process and the will of the electorate accountable for their actions."
The U.N. advocacy director for Human Rights Watch, Philippe Bolopion, called on the Security Council to "put Gbagbo on notice that he will be held personally accountable if he allows the kind of gross abuses that have characterized past crack-downs of his security forces against political opponents."
It was the job of Y.J. Choi, the special envoy in the Ivory Coast of U.N. Secretary-General Ban Ki-moon, to review and sign off on the results.
Choi said that, even if Gbagbo's complaints were taken into consideration, Ouattara was the winner.
"Having evaluated all the tally sheets, 20,000 of them yesterday evening, we are in a position to know what happened really," Choi told CNN in a telephone interview from Abidjan. "With absolute certainty, we know that Ouattara won the election."
He added that the U.N. forces would ensure that the popular will will prevail and would also seek to minimize any violence that might occur. "That is our job," he said.
The specter of violence was a real one in a nation that has seen more than its fair share since 2002, when civil war erupted.
Prior to a final resolution, the army had closed off national borders as a security precaution.
"The air, land and sea border of the country are closed to all movement of people and goods starting this day, Thursday, December 2, 2010, from 8 p.m. local until further notice," Army Col. Maj. Babri Gohourou said on television.
Authorities also blocked all international media broadcasts in the Ivory Coast.
"In order to maintain social peace, the National Broadcasting Council has ordered the French cable provider Canal Plus Horizon to suspend, without a delay, all the foreign radio and TV channels which are broadcast in Ivory Coast," a National Broadcasting Council spokesman said.
Gbagbo finished slightly ahead of Ouattara in the initial election last month with 38% of the vote to the challenger's 32%.
Ouattara, a former economist for the International Monetary Fund, had been banned from previous races. Gbagbo's critics said the incumbent stoked tensions by accusing Ouattara of masterminding the civil war. Ouattara has denied the allegation.
Once a prosperous nation and a driving force in West Africa, the Ivory Coast plunged into instability after fighting erupted between the government-held south and discontented Muslim rebels living in the north. Thousands of people died in the conflict.
Now, the disputed election threatens to spill more blood.
Skirmishes at Ouattara's office Thursday left at least eight people dead and 15 wounded, officials said, and an army official said on national television that soldiers were attacked during a patrol.
Witnesses said they were attacked by government security forces, and others reported an exchange of gunfire between security forcse and snipers at Ouattara's office.
Amnesty International condemned what it called "an armed raid led by a paramilitary force" on Ouattara's offices in Abidjan Wednesday.
Gohourou, the army spokesman, issued a statement on state TV Friday warning that officials at the military headquarters have learned that some individuals "are planning to dress up in military uniforms to attack French interests in Ivory Coast. Their objective, without a doubt, is to bring the blame and responsibility of their actions on the defense and security forces of the Ivory Coast."
Military and security patrols have been warned to intercept any attack, Gohourou said. Those apprehended will be prosecuted and people should remain vigilant by alerting authorities, he said.
France, with thousands of its citizens living in the Ivory Coast, urged "calm and responsibility," in the tense situation.
The French Foreign Ministry said it hopes "that the main Ivorian political actors respect the political will expressed by the Ivorian people and, in doing so, respect the process of democracy in this country."
CNN's Pierre Meilhan contributed to this report.