Groups of Moroccans went out to pray and to protest in the streets at the weekend, defying orders to stay at home to combat the spread of the novel coronavirus.
Images shared on social networks and broadcast by local media showed people chanting “God is greatest and only he can help us,” in cities of Tangiers, Fez and Tetouan.
Some spoke of the virus as a “divine test”.
Mosques in Morocco are closed and religious authorities have told the faithful to pray at home.
A public health state of emergency went into effect in the Muslim-majority country on Friday evening, and security forces and the army have been deployed on the streets.
The military deployed armoured vehicles in the capital Rabat, an AFP journalist said, as well as in other cities, according to local media.
People have been ordered to stay at home, and restrictions on public transport and travel between cities are also in place.
Images circulating on social media showed the sometimes heavy-handed arrest of those not abiding by orders.
The DGSN security force said an individual had been arrested in Casablanca for selling movement permits, and a policeman in Marrakesh was under investigation on similar accusations.
Around 20 people have been arrested in recent days for spreading false information or calling for civil disobedience, the DGSN added.
Morocco last week suspended all commercial international flights “until further notice”, although special trips were authorised to repatriate stranded foreigners.
The French embassy in Morocco said on Twitter that some 140 special flights had been organised to take over 25,000 people to France.
The UK, US and Canada also organised evacuation flights, local embassies said.
The US embassy, in a tweet Friday, had warned its citizens that Moroccan airspace would close indefinitely on Sunday morning.
A special provision allowing Moroccans to return from abroad ended on Sunday at 1100 GMT, a foreign ministry statement said.
The number of officially reported COVID-19 cases in Morocco reached 108 on Sunday, with three deaths and three recoveries.
The country has two screening centres and 1,642 intensive care beds for 35 million inhabitants.