"We are saddened to have to report that due to a fire, three people were killed, so we are expressing our deepest condolences to their families," the Mexico City Penitentiary System Undersecretariat said in a statement on Thursday, Efe news reported.
The fire started around 5.25 a.m. in Dormitory 2 at the Reclusorio Preventivo Varonil Oriente, officials said, adding that it took several hours to put out the blaze.
The cause of the fire has not been determined, but investigators are working on the case, prison officials said.
Mexico City Penitentiary System Undersecretary Antonio Hazael Ruiz told Milenio Television that the fire started in a kitchen and was not the result of a fight or riot.
"We have ruled out any kind of violence or riot. It was an accident, we're not sure of its origin, possibly a small frying pan, which are electric," the official said.
Hazael Ruiz said investigators will work to determine how the fire started.
Coroner's office personnel went to the prison to remove the bodies of the three victims, who were identified as Luis Enrique Tejeda Pelcastre, Mauricio Espindola Hidalgo and Carlos Enrique Perez Marquez.
The seven people injured in the fire were transported to Belisario Dominguez Hospital, where four are listed in serious condition and the other three are under observation.
"The required complaint has been filed over the incident and the cause of the fire is under investigation," the Mexico City Penitentiary System Undersecretariat said.
Hazael Ruiz said prosecutors had joined the investigation and other prison operations had not been affected by the blaze.
Family visits will take place at the regularly scheduled times on Thursday, Hazael Ruiz said.
( With inputs from IANS )