A British man who helped set a fire outside a hotel housing more than 200 asylum seekers in Rotherham has been sentenced to nine years in prison, the longest punishment yet handed down in connection with the unrest that swept parts of England in August.

Thomas Birley, 27, pleaded guilty at Sheffield Crown Court to arson with intent to endanger life. Prosecutors said the painter and decorator was among the most active participants in the attack on the Holiday Inn Express hotel on August 4, when a crowd of about 400 people gathered outside the building and violence escalated into arson, assaults on police and racist abuse.

Judge Jeremy Richardson described Birley’s conduct as one of the most serious cases he had dealt with in recent weeks. He told the defendant that the attack had been “suffused with racism” and said Birley had plainly joined a brutal assault on officers trying to restore order. The judge also said the defendant intended serious harm for the people inside the hotel.

The court heard that Birley was filmed adding wood to a fire in a bin pushed against an exit and helping place another bin on top of the blaze. He was also recorded throwing missiles at police, confronting officers while holding a police baton and hurling a large bin into a line of shielded officers.

The risk to those inside the hotel was acute. The judge heard that 22 staff members barricaded themselves in a panic room using freezers and feared they would die in the fire. More than 200 asylum seekers were trapped inside the building during the attack, though police ultimately brought the situation under control and nobody in the hotel was injured.

The sentencing comes after weeks of violence linked to false online claims after three girls were killed in a stabbing attack in Southport on July 29. A suspect born in Cardiff has since been charged with murder. The false claim that the suspect was a Muslim migrant helped inflame protests that spread across the country.

According to the account presented in court, the Rotherham attack was part of a wider wave of far-right riots that injured dozens of police officers and led to hundreds of arrests nationwide. Friday’s sentence exceeded the six-year term that had previously been the harshest punishment tied to the disturbances.

For police, prosecutors and judges, the sentence signals that those who used the disorder to attack vulnerable people and emergency responders can expect heavy jail terms. For the hotel’s occupants and staff, the ruling also underscores how close the violence came to becoming a mass casualty event.