Myanmar President Thein Sein on Thursday vowed a tough response to religious extremists after a wave of deadly Buddhist-Muslim violence in the former army-ruled nation.

At least 40 people have been killed and mosques burned in several towns in central Myanmar since fresh sectarian strife erupted on March 20, prompting the government to impose emergency rule and curfews in some areas.

"I would like to warn all political opportunists and religious extremists who try to exploit the noble teachings of these religions and have tried to plant hatred among people of different faiths for their own self-interest: their efforts will not be tolerated," Thein Sein said in a national address.

"In general, I do not endorse the use of force to solve problems. However, I will not hesitate to use force as a last resort to protect the lives and safeguard the property of general public," the former general added.

"All perpetrators of violence will be prosecuted to the fullest extent of the law," he said, according to an official translation.

The recent clashes were apparently triggered by an argument in a gold shop that turned into an escalating riot, during which mosques were burned, houses razed and charred bodies left lying in the streets.

But witnesses say much of the violence appears to be well organised.

Thein Sein blamed the violence on unidentified "instigators" trying to "exploit the situation to engineer violence in other parts of the country."

However the United Nations Special Rapporteur on human rights in Myanmar said Thursday he had received reports of "state involvement" in some of the recent violence.

Tomas Ojea Quintana pointed to "instances where the military, police and other civilian law enforcement forces have been standing by while atrocities have been committed before their very eyes, including by well organised ultra-nationalist Buddhist mobs."

Muslim leaders in Myanmar have also criticised the security forces for failing to stop the attacks.

"These violent attacks include crimes such as arson and massacres which deserve heavy penalties," the Islamic Religious Affairs Council and several other Muslim groups in Myanmar wrote in an open letter to the president.

"However, in this situation the authorities neglected to take swift and effective action against the perpetrators who recklessly committed crimes in front of them," they added.

It is the worst sectarian strife since violence between Buddhists and Muslims in the western state of Rakhine last year left at least 180 people dead and more than 110,000 displaced.

The communal clashes pose a major challenge to Thein Sein, who has won international praise for his reform efforts since taking office two years ago following the end of decades of outright military rule.

"We must expect these conflicts and difficulties to arise during our period of democratic transition," Thein Sein said. "We must find strength and take pride in diversity."

Myanmar's Muslims -- largely of Indian, Chinese and Bangladeshi descent -- account for an estimated four percent of the population of roughly 60 million.

Religious violence has occasionally broken out in the past in some areas across the country, but was largely suppressed during the previous junta era.

In the main city Yangon, which has been tense but mostly peaceful, youths organised a "Pray for Myanmar" event on Thursday.

About 100 people of different religions attended the meeting, at which T-shirts and stickers with the slogan "Don't create racial and religious riots" were distributed.

"We have never faced such problem during our lifetime. It is really uncomfortable for us as we are feeling insecure and have doubts wherever we go," said co-organiser Thet Swe Win.

"We need to stop this fire from spreading."