The security forces launched a manhunt for the attackers and the escapees, the ministry said on Twitter.
The attack took place at Jaw prison south of the capital Manama.
Bahrain has been rocked by unrest since its Sunni authorities crushed Shiite-led protests in 2011 demanding a constitutional monarchy and an elected prime minister.
Hundreds of Shiites have been arrested and many have faced trials over their role in the demonstrations.
Shiite protesters continue to frequently clash with security forces in villages outside the capital Manama.