Ivory Coast is in a major political crisis, after rival presidential candidates swore themselves in.
The incumbent Laurent Gbagbo took the oath to serve a new term, but within hours Alassane Ouattara also laid claim to the presidency.
The US, UN and France say last Sunday's run-off poll was won by Mr Ouattara.
He was declared the winner by the electoral body, but this was overturned by the Constitutional Council, which is led by an ally of Mr Gbagbo.
The presidential run-off was intended to reunify the world's largest cocoa producer after a civil war in 2002, but has now left the nation with two rival presidents.
At least four people have been killed in election-related clashes this week in the country's main city of Abidjan.
On the streets opposition supporters are protesting against Mr Gbagbo's investiture, saying it amounts to a coup d'etat.
Mr Gbagbo's supporters insist the UN does not have the right to say who won the elections and have threatened to expel the head of the 8,000-strong UN mission.
Ivory Coast has closed its borders and stopped broadcasts of international news media into the country. An overnight curfew remains in place over the weekend.
"I swear solemnly and on my honour to respect and faithfully defend the constitution," Mr Gbagbo said during the swearing-in ceremony in Abidjan on Saturday.
Mr Gbagbo took the oath to loud cheers from a number of his supporters at the presidential palace.
"In recent days I have noted serious cases of interference," he said.
"I am charged with defending our sovereignty and I will not negotiate on that. I have never called on someone from outside to put me in office," Mr Gbagbo added.
Within hours, Mr Ouattara, a former rebel from the predominantly Muslim north of the country, was sworn in at an Abidjan hotel guarded by UN peacekeepers.
"I, Alassane Ouattara... swear as follows the oath of the president of the Republic of Ivory Coast," he said in a handwritten letter to the country's high court, followed by the wording of the formal oath of office, AFP news agency reports.
Mr Ouattara has earlier said that "the Constitutional Council has abused its authority, the whole world knows it, and I am sorry for my country's image."
After the swearing-in, he immediately re-appointed Guillaume Soro as his prime minister. Mr Soro had tendered his resignation in Mr Gbagbo's administration just hours earlier.
Mr Soro - who is the head of the New Forces rebels in the north - has warned that overturning the results threatens to derail attempts to stabilise and reunify the country after the war.
On Thursday, the Independent Electoral Commission (IEC) declared that Mr Ouattara had won the 28 November run-off by 54.1% to 45.9%.
But after Mr Gbagbo and his supporters alleged the ballot had been fraudulent in some northern region, the Constitutional Council - run by Mr Gbagbo's ally - overruled the Commission.
The council said Mr Gbagbo had secured just over 51% of the vote.
Mr Gbagbo also has the backing of the head of the country's armed forces.
'Held to account'
US President Barack Obama has rejected the Constitutional Council's decision.
"The Independent Electoral Commission, credible and accredited observers and the United Nations have all confirmed this result and attested to its credibility," he said.
He congratulated Mr Ouattara and said the international community would "hold those who act to thwart the democratic process and the will of the electorate accountable for their actions".
French President Nicolas Sarkozy told Mr Gbagbo to "respect the will of the people, abstain from any action that might provoke violence" and to help establish peace.
UN Secretary-General Ban Ki-moon earlier called on Mr Gbagbo "to do his part for the good of the country and to co-operate in a smooth political transition".
Nigerian President Goodluck Jonathan, the current chairman of regional bloc Ecowas, said all parties should "respect and fully implement the verdict of the Ivorian people as declared by the Independent Electoral Commission".
The head of the UN mission in Ivory Coast also said it regarded Mr Ouattara as the winner.
The African Union said it was "deeply concerned" by the developments and pledged to take action against "the authors of acts likely to undermine the integrity of the electoral process" as proclaimed by the IEC.
The head of the International Monetary Fund, Dominique Strauss-Kahn, said the IMF would only work with an Ivory Coast government recognised by the UN.