"Grease devils" is a common local term for men who sneak into private houses at night to molest sleeping women. They are popularly said to cover themselves in grease to evade capture.
Tuesday's clash was the first outbreak of violence between troops and minority Tamils in northern Sri Lanka since the military crushed the Tamil Tiger rebels in 2009, ending nearly four decades of ethnic civil war.
The overnight unrest came a day after a mob killed a constable who tried to rescue a drunk fishermen mistakenly taken by residents to be a "grease devil", police said.
Fears about sex offenders have spread rapidly through the villages of Sri Lanka over the past month, and last week in the island's central region two men also suspected of being sex offenders were killed by locals.
Some Sri Lankans blame soldiers and police of being involved in the alleged "grease devil" activity and of protecting the offenders, a claim the authorities have vehemently rejected.Police said they had arrested at least 100 suspected sexual offenders in the past three months.