"Some 100 fully armed militants stormed the base, where there were 60 marines," Colonel Pramote Promin, southern army spokesman, told AFP.
He said the attack, one of the most ambitious in several years of violence in Thailand's deep south, had resulted in the deaths of at least 17 assailants.
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," Pramote told Thai television.
"We were able to secure the camp. All of our force are safe," he said.
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 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, Crisis Group'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 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.