MADRID — The scene is becoming all too familiar, and now it has gripped Spain: Streets are empty, shops are shuttered, families are cloistered at home and the numbers of those infected with the coronavirus, and those who have died, are growing.
Spain — like Italy and France to varying degrees — is now on lockdown, struggling to contain a virus that already seems out of control, with about 8,000 people infected and almost 300 dead. In the center of Madrid, police patrolled the streets, with few cars passing along its main artery, the Castellana. In Barcelona, the Gothic Quarter was empty, and private security kept anyone from entering the cathedral.
Spain’s prime minister, Pedro Sánchez, said he was imposing drastic measures to fight the coronavirus, forcing people to stay indoors, with exemptions only for so-called exceptional circumstances.
“The situation is no joke,” said Sergio González, 26, as he walked his dog in Barcelona, a mask covering his face.
Spain’s 47 million citizens had another concern, too, one that has echoed across the West: how to balance democratic values and practices while trying to change people’s behavior to safeguard their health.
That debate, which has surfaced in countries from Israel to France, has special resonance for the Spanish, after a transition to democracy only in the late 1970s. It has also exasperated tensions between the central government, which is imposing strict measures of social control, and some regional governments that have long bristled at Madrid’s interference in their affairs.
For the Spanish, the coronavirus has also highlighted their fractured political scene. A left-wing minority government came to power promising to curtail the authority of the police to control public gatherings — which increased under a 2015 law introduced by a previous, conservative administration — only to step up police powers.
“The majority of the Spanish population wants to overcome this virus as soon as possible, so I’m convinced the majority will comply” with the stay-at-home rules, said Prime Minister Sánchez when he declared a state of emergency on Saturday.
For the moment, at least, it looked like Spaniards had accepted the limits on civil liberties in order to defeat the coronavirus.
While bakeries and small supermarkets remained open, as providers of essential food supplies, some shopkeepers said they initially did not know what to do.
“Is jamón a primary need?” asked Pol Aranda, a seller of Spanish ham at a gourmet store near Barcelona’s City Hall, who was ordered by the police to close on Sunday.
As he rolled down the shop’s curtain at midday, Mr. Aranda tried to end on a light note.
“All the regional officials and public employees working nearby came to stockpile a lot of food yesterday, so it looks like for some, it’s definitely essential,” he said.
Since its return to democracy after the 1975 death of Gen. Francisco Franco, the Spanish government has had a state of emergency only once, in 2010, when air traffic controllers held a wildcat strike. Military intervention swiftly reopened the country’s airports.
This time, the main opposition party agreed on the need to take such measures, lambasting Mr. Sánchez as having acted too late but saying it would probably approve an extension after the order expires in 15 days.
Still, there was concern about enforcement as regional tensions rose to the surface.
Politicians in the Catalan and Basque regions — where there have been strong independence movements — have insisted that the state of emergency should not be used to take over their specific regional powers, which include running their own police forces and managing hospitals.
On Sunday, the local news media were already reporting some law-and-order contradictions. While police officers in Madrid let off some cyclists with a warning for taking an illegal leisure ride, Catalan officers fined cyclists instead.
Many locals were struggling to understand Spain’s new order, with many questions left unanswered and a lack of clarity over who would be punished for breaking rules.
An Uber driver in Madrid said she was afraid to take clients and wondered if drivers would also be held responsible if the police decided a passenger should not have been out.
Jorge Muñoz, a bank employee in Madrid, said he was unsure how much the lockdown would impact his joint custody agreement for his son.
“I would normally take him to school on Monday, but the school is, of course, shut,” he said. “I’m not sure if I’m going to get stopped by police for driving him to his mother’s instead.”
One of the immediate challenges for police officers on Sunday was to persuade tourists to abide by the new rules. Some seemed to see the measures as another major blow to the principles of the European Union, built on the idea of removing borders on the Continent.
“We are so used to free movement in Europe that the only way authorities can make us follow an order seems to be by putting the police out in the streets,” said Leonie Missfeldt, a 24-year-old German student who was taking a last walk by the beach in Barcelona before heading home on Monday.
Marika Shinozuka and Kazuki Hayashi, both from Japan, said they wanted to squeeze in more sightseeing before leaving Barcelona on Monday, earlier than planned.
“We’re wearing our masks and being careful,” Ms. Shinozuka said as she posed in front of a mural depicting Uncle Sam and the message “I Want You To Stay Home!” “We are all in the same boat now.”
Raphael Minder reported from Madrid, and Elian Peltier from Barcelona.