The government ordered popular social media networks blocked in an attempt to stop the violence from spreading, and thousands of police and soldiers spread out across the worst-hit areas.

The police also ordered a curfew across much of the region for a third straight day, trying to calm the situation.

Hundreds of Muslim residents of Mullegama, a village in the hills of central Sri Lanka, barricaded themselves inside a local mosque after Buddhist mobs attacked their homes Wednesday morning accusing them of stealing the donation box of a nearby temple. At least 20 Muslim homes appeared badly damaged and flames engulfed one two-story home.

The Muslims hiding in the mosque, speaking on condition of anonymity because of fear of reprisals, said police prevented them from saving their property and did nothing to stop the attackers.

One Sinhala Buddhist man who was part of the attack died in an explosion and another man was injured, according to the men in the mosque. A local Buddhist man said the Muslims were using improvised explosives, which the men in the mosque denied.

The police officials said they could not immediately identify what caused the explosion or who was responsible.

Mullegama Piyaratana , a Buddhist monk at the temple, said the attacks on the Muslim homes took place after some people pelted the temple with rocks late Tuesday. He would not identify who attacked the temple.

In the nearby small town of Katugastota, Ikram Mohamed, a Muslim, stood outside the wreckage of the textile shop where he worked, after Sinhalese Buddhist mobs set it on fire. He and the owner had closed the shop Wednesday morning when police announced the curfew. They returned to find it destroyed, and clothing and dressmaker dummies smoking in the ruins.

“There are many good Sinhalese people,” he said. “This is being done by a few jealous people.”

Muslims own many of the small businesses in Sri Lanka, a fact that many believe has helped make them targets as Buddhist-Muslim relations have worsened in recent years amid the rise of hard-line Buddhist groups, which accuse Muslims of forcing people to convert and destroying sacred Buddhist sites.

Area residents said mobs swept through at least two towns in the central hills Wednesday, attacking two mosques and a string of Muslim-owned shops and buildings.

An internet company official, meanwhile, said the government had ordered popular social media networks blocked in areas near the violence, and slowed dramatically across the rest of the country.

The official, speaking on condition of anonymity under company policy, said the order was for Facebook, Instagram, Viber and WhatsApp. Some of those networks appeared to be blocked in Colombo, the capital, while others worked sporadically and very slowly.

President Maithripala Sirisena declared the state of emergency on Tuesday, though a day later details of the decree remained unclear. While the hills were flooded with soldiers and policemen ordering people off the street, little, if anything, appeared to have changed elsewhere in the country.

While government officials have not directly accused Buddhist extremists of being behind the violence, many comments appeared aimed at them.

The government will “act sternly against groups that are inciting religious hatred,” Cabinet minister Rauff Hakeem said Tuesday after a meeting with the president.

The emergency announcement came after Buddhist mobs swept through towns outside Kandy, burning at least 11 Muslim-owned shops and homes. The attacks followed reports that a Buddhist man had been killed by a group of Muslims. Police fired tear gas into the crowds, and later announced a curfew in the town.

The U.N. office in Colombo condemned the violence.

“The United Nations urges authorities to take immediate action against perpetrators and to ensure that appropriate measures are swiftly taken to restore normalcy in affected areas,” it said in a statement Wednesday.

Denmark and Norway warned their citizens in Sri Lanka about the state of emergency, saying they should be “cautious, stay away from large crowds and demonstrations, follow media and listen to advice from local authorities.”

The Norwegian foreign ministry urged people “to stay in touch with family and relatives in Norway.”

Sri Lanka has long been divided between the majority Sinhalese, who are overwhelmingly Buddhist, and minority Tamils who are Hindu, Muslim and Christian. The country remains deeply scarred by its 1983-2009 civil war, when Tamil rebels fought to create an independent homeland.

While the rebels were eventually crushed, the Buddhist-Muslim religious divide has taken hold in recent years.

The AP is one of the largest and most trusted sources of independent newsgathering. AP is neither privately owned nor government-funded; instead, as a not-for-profit news cooperative owned by its American newspaper and broadcast members, it can maintain its single-minded focus on newsgathering and its commitment to the highest standards of objective, accurate journalism.