By Alastair Leithead
BBC News, southern Thailand
Civilian groups, some including women, are being armed
So far the wars of the 21st Century have revolved around insurgencies with nameless, faceless and often fearless fighters bombing, shooting and beheading with little care for their own lives.
Afghanistan and Pakistan show how difficult and expensive these insurgencies are to counter and how disruptive and divisive they can be even with ill-defined, non-specific objectives.
Thailand seems about as far from the Taliban as you can get, yet just a short distance from its golden tourist beaches and paradise islands, an insurgency has been raging for five years.
Someone is killed on average every day in the provinces on the country's southern border with Malaysia, where a shadowy group of Islamist extremists are stirring up a deepening sectarian divide.
In just five years 3,800 people have been killed and more than 6,000 injured. But what they want is not totally clear and no group has ever publicly admitted it carried out an attack.
They have no links to al-Qaeda and few ties to foreign organisations except perhaps a few cash donations to keep the Islamic extremist message of violence going.
Tens of thousands of troops have been deployed, and now civilians appear to be encouraged to take the law into their own hands.
At the local Buddhist temple at Trohgen village in Pattani province a class is being held for a group of mostly female community volunteers - but this is no religious ceremony.
Some of Monthira Peng-Iad's relatives have been killed
It is a refresher course to remind them how to clean, maintain and use the shotguns they have been given by the government for their own protection.
"It's getting more violent every day," said Monthira Peng-Iad, a 40-year-old farmer.
"So many of my relatives have been shot and killed I feel bitter inside. I want to know how to shoot, so I can help people in the village."
In a community in which Muslims and Buddhists used to live side-by-side in peace, her rhetoric shows how divisive the insurgency has been.
"It's time to fight otherwise all the Thai Buddhists will be killed. We used to be friends and relatives but now we are divided. Now they see all of us as enemies. They kill us."
One human rights group says up to a hundred thousand civilian Buddhists and Muslims have been given guns to "protect" themselves in the three southern provinces of Thailand, but this is a figure the military denies.
However many guns there are, the violence doesn't appear to be abating.
At al-Furquan mosque in Ai Payae village, Narathiwat province, there are more armed men on guard outside than there are inside for afternoon prayers.
The group of 18 Muslim men were armed by the government but did not appear particularly well-drilled in weapons safety.
They were brought in after an attack on the mosque in June when gunmen opened fire killing ten people and injured 12.
Ayu Jeh-Ngoh was shot twice, once in the back and once in the leg as he prayed. He suspects the attackers were from a nearby Buddhist village, taking revenge after a Buddhist was killed in the area.
Others in the area suspect a similar thing, but nobody has been charged with the attack and they said the investigation did not appear to be going anywhere.
The victims are often civilians, especially teachers, who in the most dangerous areas travel to school on motorbikes in groups with armed soldiers as outriders to protect them.
Sukhon Deangchot teaches at a school which has already been bombed once.
"We're really worried about our security when going to work. I've no idea who is targeting us," she said.
Hearts and minds
Tens of thousands of troops are still struggling to contain the violence.
Thousands of auxiliaries have been trained and civilians have been armed or given radios and drafted in as spies on neighbourhood watch.
Lt Gen Kasikorn Keereesri is the Combined Task Force commander. He is trying all sorts of counter-insurgency tactics to win people over and isolate the bombers.
Schools, mosques and markets have all been targeted
"The number of incidents is decreasing, but every time something happens it is more violent and it causes more damage," he said.
"The insurgents have started to attack more in big cities now using car bombs which cause more damage inside the city.
"Our strategy is that we have to control the insurgents' freedom of movement in the villages. We have to win the hearts and minds of villagers and make them side with us."
It is a similar challenge facing American and Nato troops in Afghanistan and it is far from easy, even with their huge resources.
Farming courses are run to help poorer people and money is spent on other projects, but there have been human rights abuses carried out by some members of the security forces - something the general accepts has not helped, but says is now being addressed.
Both sides are being dragged into the division and instability which the insurgency brings.
"My house was burned down, my husband was shot dead, my daughter was shot and my son disappeared," said Kuang Narumon, a 52-year-old Buddhist.
"We don't trust each other now," she said with a nervous, fixed smile. "We're separate - not like we used to be."