Officials say the clash erupted when prisoners attacked a team of police commandoes that entered the prison to search for smuggled drugs and cellphones. The prisoners armed themselves by breaking into the armory, they said.
The country's main opposition party has called the clash a "cold-blooded massacre" of prisoners and demanded a parliamentary investigation.
The prison houses 3,621 inmates, and regular searches are carried out by officials for smuggled objects, prison reforms minister Chandrasiri Gajadeera said.
He said police commandoes were summoned to assist with the search on Friday after prison officials had to call off three previous searches because of resistance from prisoners.
Prison violence is fairly common in Sri Lanka. Human rights groups say at least two people died after being beaten by guards during a prison revolt in June. Another clash earlier this year at Magazine Prison, located next to Welikada, injured 28 inmates and guards.