The number of people killed in Sri Lanka's worst prison riot in nearly three decades rose to 16 while another 43 escaped with injuries, officials said Saturday.

The toll rose as three more people succumbed to their injuries following gunbattles between rioting inmates and security personnel at Colombo's Welikada jail, Colombo National Hospital director Anil Jasinghe said.

Violence broke out as police Special Task Force (STF) commandos carried out a search inside the prison for drugs and smuggled mobile phones, a military official at the scene told AFP on Friday night.

"Some of the inmates grabbed weapons and used them," the officer said, asking not to be named. "The situation is now totally under control."

"Sixteen people have been killed and another 43 are being treated by this morning," hospital director Jasinghe told AFP. "Among those in hospital are 13 STF personnel, four soldiers and one civilian bystander."

During the rioting, some of the convicts had tried to escape and were shot by security forces, witnesses said adding that teargas too had been fired at rioting prisoners.

Some of the inmates got onto a roof and fired at troops and police on the ground. Police and troops fired back with intermittent gun fire heard for at least three hours, witnesses said.

Troops used armoured vehicles to move in reinforcements as inmates kept on firing, witnesses said.

Afghan, Indian and Pakistani inmates were also at the same jail, but none of them had been taken to hospital.

Friday's violence was the worst riot at the maximum security Welikada jail since July 1983 when more than 50 ethnic Tamil prisoners were massacred by majority Sinhalese prisoners during anti-Tamil riots that had gripped the country.

The identity of Friday's victims was not immediately clear, but witnesses said the dead appeared to be inmates. A hospital source, however said, a jail guard was also among those killed.

"The STF search inside the prison went on for about five hours and they recovered a lot of contraband," another security official told AFP. "As commandos were completing their raid, the inmates turned on them."

There had been no official word from the authorities about the violence.

The stand off between rioting inmates and security personnel lasted several hours. Convicts left the roof as the area plunged in darkness after the authorities switched off electricity.

Jasinghe said the head of the STF, deputy inspector-general R. M. Ranawana, had suffered gunshot injuries and was being treated at the hospital.

There was similar violence at the same penitentiary in January when 25 inmates and four guards were wounded.

In 2010, more than 50 police and prison guards were wounded in a riot during another raid to seize illegal mobile phones.