The Yugoslav war crimes tribunal overturned the convictions of two Croat generals on Friday for murdering and illegally expelling Serb civilians in a 1995 military blitz.

The decision, by a 3-2 majority in the U.N. court's five-judge appeals chamber, is one of the most significant reversals in the court's 18-year history and overturns a verdict that dealt a blow to Croatia's self-image as a victim of atrocities, rather than a perpetrator, during the Balkan wars in the 1990s.

Neither Ante Gotovina nor Mladen Markac showed any emotion at the decision, but their supporters in the court's packed public gallery cheered and clapped as Presiding Judge Theodor Meron ordered both men freed immediately. On a lawn outside the tribunal, supporters sang, waved a Croat flag and sipped champagne.

The ruling was hailed as a major victory by Croatia and a scandalous injustice by Serbia.

The generals were returned to their jail cells to complete release paperwork before being flown back to Croatia, likely Friday afternoon.

"I think right now what he wants to do is go home to his wife, his little boy, his daughter," said Gotovina's American lawyer, Greg Kehoe.

Gotovina and Markac were sentenced to 24 and 18 years respectively in 2011 for crimes, including murder and deportation. Judges ruled both men were part of a criminal conspiracy led by former Croat President Franjo Tudjman to expel Serbs.

But the appeals judges said prosecutors failed to prove the existence of such a conspiracy, effectively clearing Croatia's entire wartime leadership of war crimes in the operation known as Operation Storm.

The operation came at the end of Croatia's battle to secede from the crumbling Yugoslavia and involved grabbing back land along its border with Bosnia that had earlier been occupied by rebel Serbs.

"Does this vindicate that particular operation as a proper and just attempt to bring back this land under Croatia? Of course," Kehoe said.

Croatian Prime Minister Zoran Milanovic called the ruling "an important moment for Croatia."

"We are talking about two innocent people. I say thank you to them for surviving so long for the sake of Croatia," he said.

The country's liberal president, Ivo Josipovic, said the ruling is "proof that the Croatian army did not take part in a criminal enterprise" and "a symbolic satisfaction for all victims of the war."

Vesna Skare Ozbolt, former legal adviser of late President Tudjman, called the verdict "a victory of justice."

"It corrects all wrongs about our just war," she said. "This proves that there was no ethnic cleansing in Croatia and that it was all lies."

Tudjman died in 1999, while under investigation by the tribunal.

While supporters of the generals at home in Croatia cheered and set off fireworks, the acquittals enraged hardline opponents of the U.N. court in Serbia who accuse its judges of anti-Serb bias.

The headline in the Blic daily's online edition read: "Scandalous decision: Gotovina and Markac free as if there had been no operation Storm."

Some 600 Serbs were killed and more than 200,000 were driven from their homes during the operation.

Serbia's war crimes prosecutor Vladimir Vukcevic also branded the ruling "scandalous," saying it endangered the general principle that war crimes must be punished.

"This was one of the biggest war crimes in the former Yugoslavia, murder, expulsion and endangering of several hundred thousand people and no one was held responsible," Vukcevic told The Associated Press.

Rasim Ljajic, the Serbian government official who deals with the tribunal, said the court has "lost all credibility."

"What happened today is just evidence of selective justice which is worse than any injustice," Ljajic said. "The decision will only worsen the perception of the tribunal in our public."

Gotovina's and Markac's convictions were one of the few at the tribunal to punish perpetrators of atrocities against Serb civilians. The majority of criminals convicted have been Serbs. The Bosnian Serb wartime leader and military chief, Radovan Karadzic and Gen. Ratko Mladic, are currently on trial for allegedly masterminding Serb atrocities.

Gotovina, 55, is especially popular among Croatian nationalists. The charismatic former soldier fought in the French Foreign Legion in the 1980s and spent four years on the run from justice before being captured in the Canary Islands in December 2005.

The verdicts against the two generals had triggered anti-Western sentiments among nationalist Croatians ahead of the country's planned European Union entry in July 2013.

The original convictions were based on a finding that Croat forces deliberately used illegal artillery attacks on four towns to drive Serb civilians from their homes. But appeals judges overturned that key finding and said that therefore no criminal conspiracy could be proven.

Kehoe said the appeals judgment did not undermine the tribunal's credibility, but in fact proved its impartiality.

"Is it a vindication for the rule of law and justice? Yes it is," he said.

Croatian war veterans celebrated in the main square of the capital, Zagreb.

"Finally, we can say to our children that we are not war criminals," said veteran Djuro Vec. "We fought for justice, and that our fight was righteous and just."