Gunfire also broke out after the bombs exploded. (Representational)
Bombs inside parcels exploded at Myanmar's biggest jail on Wednesday prompting soldiers to return fire in a confrontation in which at least eight people were killed, state media and a witness said.
An armed anti-junta group claimed responsibility for the attack at Insein Prison in a statement posted on social media, saying it was "retaliation against (junta chief) Min Aung Hlaing".
"Today...the Special Task Agency of Burma (STA), carried out two attacks to execute the prison head. We're retaliating against Min Aung Hlaing and...the prison officers for continuously oppressing our revolution comrades," it said.
State-owned MRTV said the explosions were caused by "mines inside parcels" that killed three prison officers and five visitors and wounded 18 people. A wounded witness said gunfire also broke out after the bombs exploded at the parcel counter.
Myanmar has been in chaos since the military overthrew an elected government led by Nobel laureate Aung San Suu Kyi's party, and launched a brutal crackdown on dissent.
The witness told Reuters soldiers at the prison had opened fire in response to the blasts.
"As soon as I heard the blast, I ran out and that's when I got hurt. The soldiers...at the entrance gate fired shots recklessly," said the witness, who declined to be named because of security reasons.
The witness said they were about 10 feet (3 metres) from the blasts and were not hurt by the explosions but from shrapnel from the gunfire.
The seriously injured were evacuated from the prison, while others were treated at nearby shops. A number of cases scheduled to be heard in the court next door were cancelled, according to media.
Insein is the country's most notorious prison and thousands of political prisoners have been sent there since last year's coup.
Activist groups condemned the attack, and called for perpetrators to be "held accountable for their actions".
One of dozens of independent resistance groups fighting against the military dictatorship in Myanmar, the STA has carried out several attacks, including a raid in August on Thingyunkyun township's immigration office.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)