The election commission said Alassane Ouattara had won the November 28 poll with 54.1 percent but the top legal body, citing alleged intimidation, scrapped hundreds of thousands of votes on Friday and handed victory to Gbagbo.
Gbagbo's swearing in was broadcast live on state television, and comes after the head of the West African country's army declared his continued allegiance to Gbagbo late on Friday.
Ouattara has also been backed in his rejection of Gbagbo's re-election by rebels still running the north after a 2002-03 civil war, and Prime Minister Guillaume Soro, a former rebel himself, who said he would resign.
"I will continue to work with all the countries of the world, but I will never give up our sovereignty," Gbagbo said to cheers and the sound of vuvuzelas after being sworn in.
Residents of the main city Abidjan reported gunfire in several districts overnight and heard heavy weapons fire in Port Bouet, near the airport, but could not say who was involved.
Protests and tyre-burning broke out on Saturday in several towns, including Abidjan and in the northern town of Bouake, but none were on a large scale.
"We want (Ouattara) as president. We don't want Gbagbo anymore. We are tired of him," said Bouake resident Samba Diakite.
The African Union said it would send former South African President Thabo Mbeki to try to seek a solution to the crisis.
World leaders, including U.S. President Barack Obama, the head of the United Nations and West African regional body ECOWAS said Ouattara was the clear winner of a poll meant to heal wounds after a decade of division.
Gbagbo critics have pointed out that Paul Yao N'dre, president of the Constitutional Council which reversed the poll result, is a staunch Gbagbo ally, and Ouattara's party has warned denying him victory would risk throwing the country back into north-south conflict.
But Gbagbo's camp has rejected outside pressure, threatening to throw the U.N.'s top envoy out of the country.
French President Nicolas Sarkozy called Ouattara's win "incontestable". Such comments are likely to play into the hands of Gbagbo, a master at whipping up anti-French sentiment and who accuses the former colonial ruler of backing Ouattara.
The hotly contested run-off was due to cap the protracted process of reunifying a country that was once West Africa's brightest economic prospect.
Ivory Coast is the world's top cocoa grower and cocoa futures closed up 2.41 percent to 1,955 pounds on Friday and Ivory Coast's $2.3 Eurobond yielded 11.67 percent, from below 10 percent after round one.
Test of resolve
A peaceful first round gave way to a divisive second round, with Ouattara winning most of the north but Gbagbo saying provisional results there were marred by rebel-led intimidation. The rebels deny the charge. Ouattara says international backing shows he is the rightful president.
At least 15 people have been killed in election-related violence in the last 10 days but there are fears of more. Rebel forces said they were on high alert for a government attack.
Donors, led by the United Nations which was to certify results under a 2007 peace deal, spent $400 million on the poll.
Election observers said intimidation marred voting in rebel and government territory but said overall the vote was fair.
The U.N. envoy, who received copies of the count from almost every polling station, said even if all the allegations of fraud were true, they would still not have changed the result.
In what diplomats said was an unusually strong endorsement, U.N. Secretary-General Ban Ki-moon congratulated Ouattara on his win and called on Gbagbo to cooperate in the transition.
The regional body ECOWAS, led by economic powerhouse Nigeria, also supported Ouattara's victory. But diplomats in New York said Russia, whose Lukoil has an exploration block in Ivory Coast, had blocked the U.N. Security Council from also doing so.
The lack of Security Council consensus on the U.N. position could encourage Gbagbo to ignore outside pressure.