Iranian police have dispersed crowds who forced their way into two popular shrines soon after they were closed because of the threat from the coronavirus outbreak.

Shia Muslims entered the Imam Reza shrine in Mashhad and the Fatima Masumeh shrine in Qom on Monday night, protesting at the closures announced earlier in the day on Iranian state television.

The shrines are normally open for prayers around the clock. Health officials had told pilgrims that kissing and touching the shrines could spread the virus, and had urged clergy to close them for weeks.

Worshippers who entered the shrines chanted objections to the closures. In a statement, religious leaders and a prominent Qom seminary urged pilgrims to rely on wisdom and patience during the crisis.

The incident comes as religious authorities all over the world take steps to limit contact or close places of worship in response to the pandemic.

The virus has erupted as the world’s most popular religions prepare for important festivals during which large numbers of people usually gather to pray and celebrate. Easter and Passover take place next month, and the Islamic holy month of Ramadan – during which most of the world’s 1.8 billion Muslims will fast – begins around 23 April.

At the Vatican, the spiritual and administrative headquarters of the global 1.2 billion Roman Catholic population, Holy Week celebrations and services will take place without the physical presence of worshippers. Instead, they will be livestreamed, and broadcast on radio and television.

The square in front of St Peter’s Basilica is closed in compliance with the Italian government’s ban on gatherings. The pope’s daily 7am mass, the Angelus on Sundays, and his weekly general audience are being livestreamed and broadcast “so as to reach the faithful all over the world,” the Vatican said.

However, on Sunday Italian police dispersed people attending a mass at the church of St Francis of Assisi in Cerveteri, 27 miles north-west of Rome.

Fifteen people attended the service, which was being livestreamed on Facebook. Some sat outside the church’s open doors. Police entered the church after holy communion and before the final prayers of the mass.

Although some churches in Italy are open for private prayer and confession, the Italian government has ordered people to stay at home except to buy food or seek medical attention. Weddings, baptisms and funerals have been banned.

Pope Francis has urged priests to “have the courage to go out and visit the sick” and help with volunteering efforts – but many priests are over the age of 60 and therefore at greater risk from the virus.

In Malaysia, about two-thirds of the country’s 673 confirmed infections have been linked to an Islamic conference attended by about 16,000 people late last month at a mosque near the capital, Kuala Lumpur. In Indonesia, the world’s fourth most populous country, the top Muslim body issued a fatwa stating that people should not attend Friday prayers if they live in an area which has a “high or very high transmission potential” but that people in areas with “low potential for transmission” must attend.

Across Europe and the US, churches, mosques, synagogues and temples have suspended public celebration of the liturgy either at their own initiative or because the authorities have banned gatherings or religious services. Many are livestreaming services and setting up WhatsApp groups of worshippers.

The Muslim Council of Britain urged mosques in the UK to suspend all congregational activity, including Friday prayers. It said: “The obligation for Friday prayers is very important to Muslims up and down the country. Given the overwhelming majority of Muslims identify with their local mosque, its centrality to communal activities should not be understated. The choice therefore to suspend all congregational activities, is not one that has been taken lightly.”

It consulted Islamic scholars who advised that the obligation to perform Friday prayers in mosque congregations be temporarily lifted.

Harun Khan, the MCB’s secretary general, said: “Whether it be at the mosques (particularly Friday prayers) which draw crowds including the elderly, vulnerable and those at high risk, weddings, social events or simple day-to-day activities, it is imperative that this extraordinary step is taken to ensure the safety and wellbeing of our communities, and our country as a whole.”