The head of Iran's prison service has apologised after hackers leaked videos showing the abuse of detainees at Tehran's notorious Evin prison.
The hackers released security footage showing guards beating prisoners and dragging one along a floor.
On Tuesday, Prisons Organisation chief Mohammad Mehdi Haj-Mohammadi said he took responsibility for the "unacceptable behaviour".
Many political prisoners and dual and foreign nationals are held at Evin.
BBC Persian's Jiyar Gol says the leaked videos confirm decades of reports of mistreatment and abuse at prisons across Iran.
However, our correspondent adds, former political prisoners say the footage is nothing compared to what they experienced in detention. They accuse authorities of routinely using sexual, physical and psychological torture - a charge Iran's government denies.
Sweden tries man over 1988 Iran prison massacre Iranian athletes defy threats to back Olympic ban
The surveillance footage released by a hacking group called Edalat-e Ali (Ali's Justice) shows several guards beating a man in handcuffs, as well as a fight between a guard and another man in uniform.
In another video, an elderly man is seen collapsing in a car park before guards approach and begin dragging him along the floor through the prison. At one point, a Muslim cleric steps over the man as he lies in a stairwell.
Screengrab of undated video showing man watching hacked screens at Evin prison's control roomimage sourceTwitter
image captionThe hackers posted messages on the screens inside Evin prison's control room
Other footage shows guards at Evin's control room reacting as the phrase "cyber-attack" appears in Persian on screens in front of them.
The hacked screens also show a message reading: "Evin Prison is a stain of shame on Raisi's black turban and white beard" - a reference to Iran's new president, who is a hardline cleric and former judiciary chief.
On Tuesday, Mr Haj-Mohammadi apologised publicly to Supreme Leader Ayatollah Ali Khamenei and the country for the abuses seen in the videos.
"I accept responsibility for such unacceptable behaviour and pledge to try to prevent any repeat of these bitter events and to deal seriously with the wrongdoers," he tweeted.
Analysis box by Joe Tidy, Cyber reporter
CCTV or Closed-Circuit TV is surprisingly open.
Thanks to the low cost and ease of set up, a huge number of camera systems around the world are badly secured.
From shopping malls to private driveways and restaurants, there are entire websites offering thousands of live CCTV feeds open to anyone to watch.
You'd hope that CCTV inside sensitive areas like prisons is better protected, but this isn't the first time they've been hacked.
In March this year another hacker activist leaked footage from 150,000 cameras inside jails and police stations to highlight poor security.
The Evin prison hackers clearly had different motives and seem to have succeeded in their goal.
Not only have they exposed mistreatment to the world but they've also showed that so called "hacktivism" is still, even in the age of data breach boredom, a potent tool.