At least 40 people have been killed and mosques burned in several towns in central Myanmar since a new eruption of sectarian strife 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.
Security forces fired warning shots yesterday to disperse rioters and dozens of people have been detained.
But Muslim leaders have criticised the security forces for failing to stop the attacks.
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.
But "only an inclusive democratic society based on equality for all citizens will ensure peace and stability, especially in a multi-cultural, multi-ethnic and multi-faith country such as ours", he added.