Sri Lanka's President Chandrika Kumaratunga has condemned the deaths of a police official and a barber in the northern town of Jaffna.
The policeman was hacked to death by a mob after a soldier accidentally fired his weapon, killing the barber, officials say.
The president has denounced the shooting and promised compensation to the family of the barber.
A military spokesman says five soldiers have been detained.
The violence broke out after some soldiers visited a hairdresser.
One of their guns went off, fatally injuring the barber.
An angry Tamil mob stoned military vehicles and burned tyres in retaliation.
Police superintendent Charles Wijewardena visited the scene to try and calm the situation, but military officials say the crowd turned against him.
"The mob had blocked his vehicle and when he got off, he was abducted," police chief Chandra Fernando told AFP.
"We tried to secure his release through ceasefire monitors, but now we have found his body."
The president has appealed for restraint. The detained soldiers will face military and police proceedings
Military spokesman Daya Ratnayake blamed the Tamil Tiger rebels for inciting the violence in their former military stronghold.
"Without the LTTE's [Liberation Tigers of Tamil Eelam] help, this kind of thing cannot happen in Jaffna," he said.
A ceasefire has been observed by the government and rebels since February 2002, but a number of fatal incidents this year have threatened to undermine it.