The Central Asian nation's justice ministry said the riot broke out late on Sunday in Vahdat, 10 kilometers east of the capital Dushanbe, as the fighters armed themselves with knives and killed three guards and five fellow prisoners.
One of the instigators of the riot was Bekhruz Gulmurod, son of Gulmurod Khalimov, a Tajik special forces colonel who defected to Daesh in 2015 and, according to the ministry, was killed in Syria.
Security forces killed 24 prisoners and restored order in the prison which has 1,500 inmates, the ministry added.
Last November, Daesh claimed responsibility for another Tajik prison riot which followed a deadly attack by its followers on tourists in July 2018.
A Tajik man, who joined Daesh before handing himself over to the US-backed Syrian Democratic Forces (SDF), told Reuters news agency last month that many foreigners who enlisted in its self-declared caliphate were jailed or killed for trying to leave.
Tajikistan has offered amnesty to those who quit the armed group and return home, provided they've committed no other crimes.
Source: Al Jazeera