Scores of heavily armed gunmen stormed a military base in unrest-plagued southern Thailand, in a major assault that left at least 16 attackers dead, a military spokesman said.
The attack was one of the most ambitious in several years of violence in Thailand's deep south.
No military casualties were reported in the early hours assault at the base in Bacho district of Narathiwat province, one of three Muslim-dominated provinces near the border with Malaysia.
"We learned of the attack in advance from defected militants," Colonel Pramote Promin, the southern army spokesman, told Thai television. "We were able to secure the camp. All of our force are safe."
He added that a key local leader of the fighters, who wore bulletproof vests during the attack, had been killed in the clashes.
A shadowy insurgency calling for greater autonomy has plagued Thailand's far south near the border with Malaysia since 2004, claiming more than 5,300 lives, both Buddhist and Muslim.
Members of Thailand's security forces are frequently targeted in ambushes and roadside bombs, while civilians perceived to have collaborated with Thai authorities are also routinely executed.
A report by the International Crisis Group (ICG) on the violence in December said insurgents had grown "bolder and stronger" amid political inaction from successive Bangkok governments.
"The violence has evolved at a pace that is starting to challenge the ability of the government to respond on its own terms," said Jim Della-Giacoma, ICG's Southeast Asia project director.
ICG recommended a greater push towards decentralisation and closer engagement with local civil society groups and peace negotiations with insurgents.
It added that the deployment of 60,000 security forces and an emergency decree "have not achieved any appreciable decline in casualties".
Five soldiers were killed on Sunday in a bomb attack by suspected insurgents in the deep south, police said.
The bomb, which also wounded a sixth soldier, was detonated as the troops passed by in their patrol vehicle in a village in Yala, another southern province.