Police spokesman Prishantha Jayakody said the fighting began when police commandos went to Welikoda prison to conduct a search and were attacked by inmates hurling stones. He declined to provide more information.
An Associated Press photographer outside the building saw prisoners waving rifles atop the roof Friday night.
Some other prisoners piled into a three-wheeled vehicle and began driving toward a main city road before security forces outside the prison opened fire. The vehicle stopped and three unmoving bodies could be seen.
Dozens of security officers then entered the prison and volleys of gunfire rang out.
Prisoners could be heard screaming, "Stop shooting!"
Dr. Prasad Kariyawasam, an official at Colombo's main hospital, said 13 people were brought there for treatment, 11 of them security officers, one a passerby and one a prisoner. The passerby and two security officers had gunshot wounds, he said.
The violence at the prison was ongoing early Friday night.