Security personnel outside the Rattanaupap temple in Narathiwat province.

Gunmen in Thailand's deep south shot dead two Buddhist monks and wounded two others inside a temple, police said on Saturday, capping a week of deadly violence as the prime minister vowed to "punish" those responsible.

Black-clad assailants carrying rifles crept into Rattanaupap temple in Narathiwat province near Malaysia's border on Friday evening and started firing, local superintendant Pakdi Preechachon told AFP.

"The attack took place around 7:30 pm (1230 GMT) when an unknown number of gunmen dressed in black entered the temple through a rear area via a creek," Pakdi said.

"Two monks were shot dead at the temple while two others were wounded."

Since 2004 clashes between ethnic Malay-Muslim rebels and the Buddhist-majority Thai state that annexed the region a century ago have killed nearly 7,000 people, mostly civilians of both faiths.

The death toll in the south dropped to a record low last year as Thailand's junta tightened its security web but violence has boiled over in recent days, raising concerns about soft targets at schools and religious institutions.

In the past, Buddhist monks have been targeted only infrequently.

In the past, Buddhist monks have been targeted only infrequently.

But they have been told to suspend morning alms collection starting from Saturday in three southern provinces and the southern army commander has instructed security officials to step up safeguards of Islamic leaders who could also be at risk.

Junta leader and prime minister Prayut Chan-O-Cha condemned the temple shootings.

"The prime minister denounced such a brazen attack and instructed officials to investigate and find the assailants to punish them," said government spokesman Buddhipongse Punnakanta.

Human Rights Watch, which said in a statement that at least 23 monks had been killed since the outbreak of the insurgency in 2004, called the assault "ghastly" and a war crime because gunmen went after civilians and a place of worship.

Pictures show monks standing next to heavily armed Thai soldiers and an alms bowl inside the temple compound with bullet holes in it.

Last week, an imam in the same province was shot dead, but it was unclear if the temple attack was related.

Friday's shooting came the same day as four security officials were wounded by two separate roadside bombs and an insurgent was shot dead in a clash near a school that sent students home for the day.

Four civil defence volunteers were also killed in a drive-by shooting outside a school on January 10 in the south's Pattani province, with security forces injuring a boy as they gunned down rebels believed to be responsible.

In a rare public statement dated January 4 the main Malay-Muslim rebel group -- the Barisan Revolusi Nasional (BRN) -- which has command and control over most of the insurgent foot soldiers, swore to "keep fighting".

"Siam (Thailand) can't hold out," the BRN wrote, signing off with a warning: "Do not help and support Siam."

Security analyst Don Pathan said the uptick in violence was connected to efforts from Thai negotiators and Malaysian facilitators across the border to "pressure the BRN ruling council to come to the table without offering possible concessions."