Ivory Coast politician Laurent Gbagbo has surrendered after a military assault on his residence in Abidjan and has been put under UN guard.
Forces of his UN-recognised successor, Alassane Ouattara, and French tanks advanced on his residence where he had been ensconced in a bunker.
Mr Gbagbo had refused to accept defeat in November's presidential poll.
Speaking hours after the arrest, Mr Ouattara said he had ordered an investigation into Mr Gbagbo's actions.
Mr Gbagbo, his wife and his "collaborators" would be investigated by the judicial authorities, he told Ivorians.
The country had just turned a painful page in its history, he said, but was entering a new era.
He promised to guarantee the personal security of Mr Gbagbo and his family, and urged Ivorians to "abstain from all reprisals and violence".
UN Secretary General Ban Ki-moon said the detention of Mr Gbagbo had brought to an end months of unnecessary conflict, and the UN would support the new government.
US President Barack Obama has welcomed Mr Gbagbo's capture and called on armed groups in Ivory Coast to lay down their arms to boost the chances of a democratic future.
He added that victims and survivors of violence in the country deserved accountability for the crimes committed against them.
UN peacekeepers had accused pro-Gbagbo forces of endangering the civilian population and asked France, the former colonial power, to take out the defiant leader's heavy weapons.
There have been allegations of atrocities by both pro-Gbagbo and pro-Ouattara forces. The UN has reports of more than 1,000 people being killed and at least 100,000 fleeing the country.
Ivory Coast's permanent representative to the UN, Youssoufou Bamba, said Mr Gbagbo would stand trial.
In London, UK Foreign Secretary William Hague said that if charges were brought, Mr Gbagbo should be tried in an orderly manner.
UN peacekeeping chief Alain Le Roy said Mr Gbagbo and his wife Simone were now under UN police guard at the Golf Hotel, where Mr Ouattara has his headquarters.
His son Michel is reportedly also with the couple at the hotel.
Mr Gbagbo was shown on pro-Ouattara TV sitting in a room, looking dazed but apparently uninjured, wearing an open shirt and white vest.
A pro-Ouattara TV channel broadcast a message from the deposed leader in which he called for an end to hostilities.
"I hope that we stop the fighting and get into the civilian part of the crisis, and that we end it quickly so the country can go back to normal," he said.
His downfall came after a day of fighting around his residence which saw French light tanks sweep in after rocket strikes from attack helicopters, while Ouattara loyalists engaged pro-Gbagbo forces.
Issard Soumahro, a pro-Ouattara fighter who said he had taken part in the final assault, told the Associated Press that French helicopters had been firing until 0300 (0300 GMT) on Monday.
"We attacked and forced in a part of the bunker," he said.
"He [Mr Gbagbo] was there with his wife and his son. He wasn't hurt but he was tired and his cheek was swollen from where a soldier had slapped him."
There are conflicting accounts of how Mr Gbagbo finally surrendered.
According to his spokesman in Ivory Coast, Ahoua Don Mello, the beleaguered leader finally "came out of his bunker and surrendered to the French without offering resistance".
A special adviser to Mr Gbagbo, Bernard Houdin, told French TV his leader would never have been taken without French help.
But French diplomats denied their forces had arrested him, insisting it was Mr Ouattara's forces.
Forces loyal to Mr Ouattara launched an offensive from their stronghold in the north at the end of March, after months of political deadlock during which Mr Gbagbo refused to recognise his rival's election victory.
As they closed in on Mr Gbagbo's power base in Abidjan, UN and French attack helicopters targeted heavy weapons being used by his forces.
Mr Ban said UN and French forces had acted strictly within the framework of a UN resolution aimed at protecting the civilian population.
He said he wanted to speak to "President Alassane Ouattara" as soon as possible.
"This is an end of a chapter that should never have been," he added. "We have to help them to restore stability, rule of law, and address all humanitarian and security issues."
Mr Le Roy told reporters after addressing the UN Security Council that the chief of Mr Gbagbo's forces had called the UN to say that he wanted to surrender weapons.
As news of Mr Gbagbo's arrest spread through Ivory Coast's second city Bouake, thousands of people flocked to the centre to celebrate, the BBC's John James reports from the scene.
Young men honked their motorbike horns and women danced up and down the boulevard waving branches and singing.
"But this doesn't mean that the war is over," said one person. "Peace will not come if all the militia have not been arrested."