The International Criminal Court has dashed Laurent Gbagbo’s hopes of a swift release following the acquittal of the Ivory Coast’s former president on charges of crimes against humanity.

Trial judges had earlier ordered Gbagbo and his right-hand man Charles Ble Goude to be immediately freed after clearing them of any role in a wave of post-electoral violence in 2010-2011 that killed 3,000 people.

Celebrations erupted outside the court and Gbagbo’s daughter Marie Laurence said an emotional homecoming to the Ivory Coast was planned, after seven years in detention.

But prosecutors filed a last-ditch challenge late on Wednesday to keep the pair behind bars while the International Criminal Court (ICC) looks at an overall appeal against Tuesday’s acquittal. “Pending the decision of the appeals chamber on this prosecutor’s request ... Mr Gbagbo and Mr Ble Goude shall remain in ICC custody,” an ICC spokesman said.

Laurent Gbagbo Photograph: Issouf Sanogo/EPA

The Ivorian pair can themselves appeal by a deadline of 11am GMT on Thursday.

Prosecutors say there is a risk that, if released now, Gbagbo and Ble Goude will refuse to return to face justice if the court later decides to overturn their acquittal.

The court’s decision to clear the two men had come as a major blow to ICC prosecutor Fatou Bensouda because it was the latest in a series of failed cases against former African leaders.

Gbagbo and Ble Goude have been on trial since January 2016 over the bloodshed that gripped the former French colony after Gbagbo refused to concede defeat to his bitter rival, and now president, Alassane Ouattara in a presidential vote.

Judges stopped the trial midway on Tuesday due to an “exceptionally weak” prosecution case, and earlier on Wednesday they rejected an initial bid by prosecutors to keep Gbagbo behind bars.

Marie Laurence had said her father planned to return home after his release. “We are so overwhelmed with joy, we are proud of Dad. He went through it with dignity,” she told reporters outside the ICC following the earlier decision.

“We assume that the plan is to go back to Ivory Coast. We don’t know how long it will take for all the paperwork.”

In Ivory Coast, however, Gbagbo still faces a 20-year jail term for “economic crimes” imposed by a local court last year.

“Any decision lies with him. We have no comment to make otherwise,” said government spokesman Sidi Tiemoko Toure when asked about a Gbagbo homecoming. He added that the government “urges calm, forgiveness and reconciliation”.

Ivory Coast faces fresh elections in 2020 to elect a successor to Ouattara, who has said he will not stand for re-election after serving two five-year terms.