About 60 inmates were evacuated after a “large fire” broke out at a prison near Shaftesbury in Dorset.
It is understood a prisoner clambered on to the pitched roof of one of the house blocks at HMP Guys Marsh, took off his clothes and set fire to them.
The blaze is believed to have damaged the roof and inmates in the block were taken to a secure area.
The prisoner was brought down from the roof and the Prison Service said there was no risk to the public.
BBC home affairs correspondent Danny Shaw said it is believed the prisoner was drunk and protesting at changes to the prison regime.
A source said the protest started around 17:00 GMT and hours later the prisoner started ripping off roof tiles before setting his clothes alight.
Emergency services were called at 20:00 GMT and discovered the fire, which is believed to have been started deliberately.
A total of 64 prisoners were evacuated from the affected area and were held in a secure zone within the prison overnight.
The inmate was treated by paramedics as a precautionary measure but not arrested.
A Prison Service spokesperson said: “Prison staff worked with the emergency services to successfully resolve an incident involving one prisoner at HMP Guys Marsh on Friday evening.”
At the prison’s last inspection in 2015, managers and staff at Guys Marsh were found to have “all but lost control”.
It was described as being in “crisis” with gangs found to be operating openly in the prison.
‘Action, not gestures’
In the report, levels of violence linked to the drug “Spice” and alcohol were “very high”, with inmates also living in fear.
Shadow Justice Secretary Richard Burgon criticised the Ministry of Justice and has asked the Department of Justice to set out what changes it made to Guys Marsh after its most recent inspection.
He added: “[The most recent] prisons and courts bill does not remedy the crisis.
“Prisons need action on the ground, not gestures from ministers.”
Dorset Police said all prisoners and staff were accounted for.
Supt Caroline Naughton said: “This was an isolated incident. An investigation is now under way to establish the exact cause of the fire. These inquiries remain ongoing.
“We would like to reassure members of the community that there is no immediate risk to those living in the surrounding area and that the incident is under control.”