Prosecutors have said they will appeal the acquittals once judges issue their written majority decision acquitting Gbagbo and Charles Ble Goude.
Prosecutors wrote in a motion that there are "exceptional circumstances for maintaining both accused's detention pending appeal" and urged judges only to release the men under strict conditions designed to ensure they do not flee justice.
But Presiding Judge Cuno Tarfusser said a majority of the three-judge panel rejected the prosecution request, clearing the way for the men to be released once logistical and diplomatic formalities are completed.
"Both Mr. Gbagbo and Mr. Ble Goude have recognized the court's jurisdiction and have undertaken to return to the court if and when their presence is required," Tarfusser said.
However, prosecutors late Wednesday appealed that decision and asked for the men's release to be suspended pending the outcome.
Gbagbo was the first former president to go on trial at the global court and his case was seen as a milestone in efforts to bring to justice the highest-ranking leaders accused of atrocities.
More than 3,000 people were killed in late 2010 and early 2011 in violence that erupted in the West African nation after Gbagbo refused to accept defeat by his rival and current Ivory Coast President Alassane Ouattara.
A small group of supporters of the two men drank Champagne and flashed victory signs outside the court after the ruling.
One of Gbagbo's daughters, Marie Laurence Gbagbo, was among those celebrating. "We are really proud," she said. "Justice prevailed, the truth came out and he's coming out the right way."
Judges first ordered the men's release Tuesday after acquitting them on charges of crimes against humanity including murder, rape and persecution.
Ivory Coast government spokesman Sidi Tiemoko Toure said the acquittals triggered "demonstrations of both joy and disapproval" in Abidjan and called for calm. The administration was thinking of the victims "and assures them of its support," Toure said in a statement.
At a hearing Wednesday morning, defense lawyers said the time had come to let the men go, with no strings attached.
"Laurent Gbagbo is no longer an accused person, Laurent Gbagbo has been acquitted," said the former president's lawyer Emmanuel Altit.
Ble Goude's lawyer Geert-Jan Knoops agreed.
"These two individuals are acquitted," he told judges. "They should be given back their natural right to freedom."
Gbagbo has been in the court's custody since November 2011 and Ble Goude since March 2014.
Their trial, which had been underway for nearly three years, was brought to an abrupt halt Tuesday when two of the three judges hearing the case ruled that prosecutors had not presented enough evidence to support their charges.
"We said all along that they've done nothing," Gbagbo supporter Abdel Bayeto said outside the court. "It was a hidden agenda, an international plot against a true son of Ivory Coast, a true son of Africa."
Associated Press writer Alexis Adele in Abidjan, Ivory Coast contributed.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.