The soldiers were killed late on Wednesday at one of the many military checkpoints that dot the southern border with Malaysia, Narathiwat provincial Governor Pracha Taerat said.
"This clearly was the work of militants who planned the attack against the rangers," Pracha said.
By his account, ten people were riding in a pickup truck that stopped at a military checkpoint in Cho-i-rong district. The people in the truck seemed to be seeking shelter from the rain, but when the soldiers approached the vehicle, they opened fire with automatic weapons.
Five soldiers were killed on the spot and two others were wounded.
Witnesses said the bullet-riddled soldiers appeared to have been shot at point-blank range.
Their deaths came after police found the decapitated body of an unidentified man early on Wednesday along a roadside in neighbouring Yala province.
The head of the man, believed to be 40 or 50 years old, was found five metres away, with a note scrawled in Thai on a sheet ripped from a notebook.
Thai border guards are in the
sights of armed Muslim fighters
"You have arrested innocent people in Ubeng village, and I will continue killing innocent people too," the note said, according to police.
"We suspect that he was murdered somewhere else and his body was dumped here," police Sub-Lieutenant Sirichai Suksaran said.
Police were alerted to the killing late on Tuesday, but officers did not go to the scene until early on Wednesday, he said.
Police say they feared the murder report was a ploy.
Deadly hoax call
Two police officers were killed by a bomb on Sunday when they went to investigate a report about a railway blockade, which turned out to be a hoax call aimed at luring the police away from their post.
More than 960 people have died in the region since January last year in near-daily attacks.
Most of the population in the southern provinces are ethnic Malay and complain that they are discriminated against by Bangkok on the basis of religion because they are Muslim.