Police imposed the island-wide curfew from 9pm local time (15:30 GMT) to 4am, a police statement said on Monday.
Officials told the AFP news agency the curfew was aimed at preventing an escalation of violence, after a second day of anti-Muslim riots in the country.
Curfews were previously limited to specific areas where attacks had taken place, including Puttalam, Kurunegala and Gamphala districts near Colombo.
Residents in Muslim areas of North Western Province said crowds attacked mosques and damaged Muslim-owned businesses for a second day on Monday.
“There are hundreds of rioters, police and army are just watching. They have burnt our mosques and smashed many shops owned by Muslims,” a resident, who asked not to be identified, told the Reuters news agency. “When we try to come out of our house, police tell us to stay inside.”
‘Several shops attacked’
Police said there were incidents of mobs pelting stones and torching motorcycles and cars owned by Muslims.
“Several shops have been attacked,” a senior police officer told AFP. “When mobs tried to attack mosques, we fired in the air and used tear gas to disperse them.”
There were no immediate reports of casualties or arrests.
Al Jazeera’s Minelle Fernandez, reporting from Habarana, said the violence was mainly local and sporadic and that authorities wanted to contain the attacks.
“Over the last 24 hours there were localised police curfews to contain tensions between Christians and Muslims in these particular areas,” she said. “The authorities are trying very hard to clamp down on this.”
Sri Lanka also temporarily banned some social media networks and messaging apps, including Facebook and WhatsApp, after a posting sparked anti-Muslim riots across several towns.
Christian groups threw stones at mosques and Muslim-owned shops in the northwest Christian-majority town of Chilaw on Sunday in anger over a Facebook post by a shopkeeper, police said.
“Don’t laugh more, 1 day u will cry,” was posted as a comment on Facebook by a Muslim shopkeeper, and local Christians took it to be a warning of an impending attack.
Mobs smashed the man’s shop and vandalised a nearby mosque prompting security forces to fire in the air to disperse the crowd.
Authorities said they arrested the author of the post, identified as 38-year-old Abdul Hameed Mohamed Hasmar, as well as a group of men in the nearby Kurunegala district for allegedly attacking Muslim-owned businesses.
Muslims make up around 10 percent of Buddhist-majority Sri Lanka’s 21 million population and Christians about 7.6 percent.
Sri Lanka has been on edge since the April 21 attacks by Muslim suicide bombers on three hotels and three churches that killed at least 257 people.
Rights group Amnesty International said there was “a worrying trend of attacks against the Muslim community coming out of Sri Lanka” following the Easter Sunday bombings.
The country’s main body of Islamic scholars, the All Ceylon Jamiyyathul Ulama (ACJU), said there was increased suspicion of Muslims.
“We call upon the members of the Muslim communities to be more patient and guard your actions and avoid unnecessary postings or hosting on social media,” the ACJU said.
Sri Lanka has used temporary bans on social media in a bid to deter misinformation and rumours.
On Twitter, Sri Lanka’s leading mobile phone operator Dialog said it had also received instructions to block Viber, IMO, Snapchat, Instagram and Youtube until further notice.
The latest unrest came as Catholic churches resumed their public Sunday masses for the first time since the bombings.
Sri Lanka has been under a state of emergency since the attacks. Security forces and police have been given sweeping powers to arrest and detain suspects for long periods.
Al Jazeera and news agencies