Twelve died of asphyxia as they tried to flee the burning buildings and 26 died of severe injuries, Vice President Prosper Bazombanza told reporters at the Gitega Prison after the fire.
He did not say what might have caused the blaze. Two local residents said the fire broke out before dawn.
Many of those who died were elderly prisoners, a resident who arrived at the prison as the fire was still raging told Reuters. He said he saw bodies being taken by ambulance from the scene.
A fire broke out in August at the same prison that authorities said was caused by an electrical problem. There were no casualties.
By Maggie Fick and Nairobi newsroom