A war crimes court in The Hague has overturned the convictions of two Croatian generals charged with atrocities against Serbs in the 1990s.
Appeals judges ordered the release of Ante Gotovina and Mladen Markac.
In 2011 they were sentenced to 24 years and 18 years respectively over the killing of ethnic Serbs in an offensive to retake Croatia's Krajina region.
The men arrived in Zagreb later on Friday to a hero's welcome. But their release was condemned in Serbia.
On Friday morning, the presiding judge at the tribunal for the former Yugoslavia, Theodor Meron, said the court had entered "a verdict of acquittal" for Gen Gotovina and Gen Markac, both aged 57.
Last year the two men were convicted of murder, persecution and plunder.
Judges at the time ruled that they were part of a criminal conspiracy led by late Croatian President Franjo Tudjman to "permanently and forcibly remove" the Serb civilian population from Krajina.
But on Friday, Judge Meron said there had been no such conspiracy.
The appeals judges also said the 2011 trial chamber had "erred in finding that artillery attacks" ordered by Gen Gotovina and Gen Markac on Krajina towns "were unlawful".
The two former generals have always argued that they did not deliberately attack civilians.
Court officials also said prosecutors would not appeal against the ruling, describing it as "the final judgement".
Neither defendant showed emotion in court, but their supporters in the gallery hugged each other and clapped after the verdict.
In Zagreb's main square, thousands of people - who watched the proceedings live on giant TV - burst into applause.
"Our generals are heroes because they risked their lives to save our country and liberate the people," student Andjela Anic, 26, was quoted as saying by the AFP news agency.
"The verdict confirms everything that we believe in Croatia: that generals Gotovina and Markac are innocent," Croatian President Ivo Josipovic said.
On Thursday, candle-lit vigils were held in Zagreb and Catholic churches around the country as war veterans and bishops asked supporters to "raise their voices against injustice".
After the verdict, the two former generals were driven from The Hague to nearby Rotterdam airport before boarding the government plane to fly back home.
"I think it is only fair to get the boys back home," Croatian Prime Minister Zoran Milanovic told reporters.
Meanwhile, Serbia's President Tomislav Nikolic condemned the verdict as "political", saying it "will open old wounds".
Serbian Deputy Prime Minister Rasim Ljajic said The Hague tribunal had "lost all its credibility", Serbia's Beta news agency reported.
Mr Ljajic said the appeals decision was "proof of selective justice which is worse than any injustice".
He added that it was "a move backwards and the public opinion of the tribunal (in Serbia) will be worse than it already is".
Gen Gotovina and Gen Markac were last year convicted over the Croatian offensive in Krajina, which had been under Serbian control since the start of the war in 1991.
About 200,000 ethnic Serbs were driven from Croatia in 1995 and at least 150 were killed in a military offensive in Krajina known as Operation Storm.
The operation to retake the region was ordered by Mr Tudjman. The Croatian leader died in 1999 while under investigation by The Hague tribunal.
The aftermath of the war is a key issue both in Croatia's domestic politics and its external relations.
The European Union made it clear to former Yugoslav republics that they will not be considered for membership until war criminals were brought to justice.
Croatia is expected to join the EU in July 2013.