Amanda Knox breaks down as she is helped away after hearing that she had been freed Reuters

There were scenes of delight inside and protests outside an Italian courtroom after judges upheld the appeal by the American student, Amanda Knox, against a 26-year sentence for killing her British flatmate, Meredith Kercher. The judges also overturned a 25-year sentence imposed on her Italian former boyfriend, Raffaele Sollecito.

A sobbing and stumbling Knox was hustled from the courtroom by police officers as members of her family embraced and wept. Sollecito hugged his lead counsel, Giulia Bongiorno. Across the courtroom, the prosecutor, Giuliano Mignini, stood alone while Stephanie Kercher, the victim's sister, consoled her mother, Arline.

Outside, several hundred mainly young people had been gathering since late afternoon. As news of the verdict swept through the crowd, whistles erupted and then a chant went up of "Vergogna. Vergogna" – "Disgrace. Disgrace."

As defence lawyers emerged from the courthouse, they were greeted with roars of disapproval from the mob, interspersed with the odd cheer.

One of Knox's lawyers, Carlo Dalla Vedova, said his client would be released from prison immediately and spend the night with her family at a guesthouse outside Perugia. She is expected to leave for her home city of Seattle on Tuesday.

The first person to reach her after the verdict was announced was Dalla Vedova's junior, Maria del Grosso. "She was terror-struck", Del Grosso said. "If I had not held her, she would have fallen."

The judges confirmed Knox's conviction for slandering her former employer, Diya "Patrick" Lumumba, whom she initially accused of the murder, and increased her sentence from one to three years. But since she has already spent four years in jail, Knox was able to walk free.

The tension in court as the verdict was delivered exploded into gasps when the presiding judge, Claudio Pratillo Hellmann, began by declaring that the American student's appeal had been rejected, before adding that the rejection only applied to the slander charge.

Hellmann, who has a distinctively metallic voice, read out the verdict in the vaulted and frescoed 14th-century courtroom that has been the scene of an appeal swept by emotion, high tension and furious dispute.

The two professional and six lay judges reached their decision after 11 hours of deliberation having earlier heard final pleas from the two appellants. Moments after the verdict was announced Knox's sister Deanna Knox gave a brief statement outside court. "We're thankful that Amanda's nightmare is over," she said. "She has suffered for four years for a crime that she did not commit."

Deanna paid tribute to her sister's legal team. "Not only did they defend her brilliantly, but they also loved her. We are thankful for all the support we have received from all over the world – people who took the time to research the case and could see that Amanda and Raffaele were innocent. And last, we are thankful to the court for having the courage to look for the truth and to overturn this conviction."

Francesco Sollecito, Raffaele Sollecito's father said he had "allowed himself some tears". Of Meredith Kercher, he said: "We will remember her with affection. I would have liked to talk to her relatives as well, as they have lost a daughter in a very cruel way. "But tonight, they [the court] have given me back my son."

Earlier, in her final statement to the court, Knox, her voice quavering and never far from breaking down, said: "I want to go home, to my life. I don't want to be deprived of my life, my future for something I have not done."

The Kerchers' legal representative had earlier said the family would accept the ruling of the appeal court, as they had accepted that at the original trial. But speaking at a press conference in a Perugia hotel, they said the "brutal death" of the British student had been overlooked.

"We respect the decision of the judges but we do not understand how the decision of the first trial could be so radically overturned," the Kerchers said last night. "We still trust the Italian justice system and hope that the truth will eventually emerge."

"I think Meredith has been hugely forgotten," said Kercher's sister, Stephanie, sitting alongside Kercher's mother Arline and brother Lyle.

"It is very hard to find forgiveness at this time," said Lyle Kercher. "Four years is a very long time but on the other hand it is still raw.

Though the judges did not immediately disclose their reasoning, they are likely to have been heavily influenced by the report of experts appointed by the court to review the forensic evidence. In June, the independent experts decided that two pillars of the prosecution case were not reliably founded.

One was a trace of Sollecito's DNA on Meredith Kercher's bra clasp, which was found more than six weeks after the discovery of her body, and which the young Italian's lawyer implied last week might have been planted. The experts said the DNA could have got there by contamination. The second key item of evidence was a kitchen knife, bearing Sollecito's and Knox's DNA, that the prosecution claimed was used to slash Kercher's throat. The experts said a third sample of DNA was not necessarily that of the victim.

Within 90 days, the judges must submit their written verdict and the various parties will then have 45 days in which to take the case to Italy's highest appeals court, the court of cassation. Under Italian law, the prosecution can lodge an appeal in the same way as the defence.

But it was expected that Knox would leave immediately for the US, and if the court of cassation were to reinstate the decision of the lower court, the authorities would have to seek her extradition.

The prosecutor who oversaw the inquiry, Giuliano Mignini, hinted more than once before the outcome that he might not seek a further ruling.

The defence argument was, from the beginning that the murder was committed during a break-in by a third person, Rudy Guede from the Ivory Coast. Guede has also been convicted, but is serving a lighter, 16-year sentence after opting for a fast-track trial.