Some of Italy's most senior police officers have been given jail sentences of up to five years for what the prosecution called a "terrible" attack on demonstrators at the 2001 G8 meeting in Genoa and an attempted cover-up.

Victims of the attack, who included several Britons, expressed delight at the ruling, which overturned many of the conclusions reached by the judges at the original trial in 2008. Mark Covell, aged 42, from Reading, who was beaten into a coma, said: "This is beyond my wildest expectations. The Italian judiciary has recognised the truth of what happened. Human rights have finally been respected here. Italians will now recognise their cops do not have immunity. But it has taken nine years, and I was at the end of my tether."

It is highly unlikely that any of the officers will go behind bars. The case has taken so long that most of the offences of which they were accused have been "timed out" by statutes of limitations.

But several of the most senior defendants were also given five-year disqualifications from public office – sanctions that could prejudice or halt their careers. None was suspended after being sent for trial.

On the night of 21 July 2001, at least 150 masked police officers wearing unnumbered uniforms attacked a school being used as a dormitory by protesters against corporate globalisation. Such was the ferocity of the beatings that followed that one commander said the school was left resembling a "Mexican slaughterhouse", its walls splattered with blood.

Twenty-eight of the injured were taken to hospital and three were put on the critical list.

The police claimed the Armando Diaz school was the headquarters of the Black Bloc demonstrators who had caused mayhem in Genoa over the previous two days, that they had found Molotov cocktails, and that an officer had been attacked with a knife. But, as was later accepted by the Italian courts, none of the victims had been involved in violence, the petrol bombs were planted and the knife attack was rigged.

Addressing the appeal judges, the chief prosecutor of Genoa said they could not overlook "the terrible injuries inflicted on defenceless people, the premeditation, the covered faces, the falsification of statements by the 93 anti-globalisation protesters, the lies about their alleged resistance [to arrest]". Under Italian law, the prosecution as well as the defence can appeal.

Though the reasoning behind the appeal verdict has yet to be published, it is clear from convictions and sentences that the judges accepted the attack was planned, and then covered up, at a high level. That in turn is an embarrassment for Silvio Berlusconi's government, which has backed the defendants throughout.

Among those convicted were Francesco Gratteri, the head of police criminal investigation, and Giovanni Luperi, who was subsequently promoted to a senior job in Italian intelligence. Both men got four years.

The head of the riot squad unit that spearheaded the raid was given five years. The two policemen who planted the Molotov cocktails were each sentenced to three years and nine months.

The original trial ended in November 2008. There was uproar in court and chants of "Shame! Shame!" from victims and their relatives as the verdict was read.

The judges handed out sentences of up to four years to some of the operational commanders. But they acquitted the senior officers, who were filmed standing outside the school as the beatings took place.

The appeal court verdict, delivered shortly before midnight on Tuesday, means 25 of the 27 defendants have now been convicted.