A major fire broke out on Saturday at Iran’s notorious Evin prison, known for housing political prisoners, journalists and foreign nationals.
Videos shared online showed flames and smoke at the site in Tehran, and gunshots and explosions could be heard.
An official quoted by state media said the situation was under control, but video footage appeared to show the fire continuing after this.
Iran has been gripped for weeks by anti-government protests.
They first erupted last month after the death of 22-year-old Kurdish Iranian Mahsa Amini in police custody. Officials said she died of a heart attack, but her family disputed this, saying she was beaten by morality police.
BBC Persian’s Rana Rahimpour said it is not yet known whether the situation at the prison is linked to the recent demonstrations.
But this could easily be the case, Rana said, as hundreds of the protesters have been sent to Evin.
State media has suggested the two are not linked, quoting an official who blamed “criminal elements” for the fire. Eight people were injured, state-controlled outlet IRNA said.
Speaking from inside the prison, Tehran’s governor told state TV that there was a riot in a wing of the prison housing petty criminals, and the situation was now completely calm.
Images shared by IRNA reportedly showed the damage inside the prison after the fire.
Dramatic footage of the fire and smoke was first posted on social media on Saturday evening.
Gunshots and explosions were audible in several videos, and in others people could be heard outside the prison chanting “death to the dictator” – one of the main slogans of the anti-government protest movement.
One video appeared to show objects fired into the prison from outside its perimeter, followed by the sound of an explosion, according to BBC Persian.
Large crowds gathered outside the prison, traffic came to a standstill and riot police were seen entering the facility.
Even after Iranian media claimed that calm had been restored, the situation at the prison was still confused, said BBC Persian’s Kasra Naji. Videos continued to appear on social media showing the fire still burning and the sound of gunshots.
Other pictures showed inmates on the roof of a section of the prison where political prisoners and many of the protestors who have been arrested in the past four weeks are kept, Kasra said.
The families of some prisoners told the BBC that they were unable to contact their relatives on the phone, which they would normally be able to do, and that internet connection around the prison appeared to have been cut off.