MADRID — Faced with a sharp rise in coronavirus cases, Spain on Saturday became the second country in Europe to impose sweeping restrictions on the public, telling everyone to stay indoors, with limited exceptions.
The government said people could leave their homes to buy food, to go to work if they cannot work remotely, to seek health care, or to assist the elderly and others in need.
The government also ordered all schools, restaurants, bars and non-essential stores to close, extending measures that various regional authorities, including in Madrid and in Catalonia, had taken in recent days. Long-distance trains and buses across the country will have less frequent service.
“Spain is demonstrating in these critical hours that it has the capacity to overcome adversity,” Prime Minister Pedro Sánchez of Spain said in announcing the new measures, which he described as drastic.
“We are facing very difficult weeks of efforts and sacrifices,” he warned. “Some important rights must be limited if we want to beat the virus.”
The final victory over the coronavirus, he added, will come only “when we have a vaccine.”
Mr. Sánchez said the government would take steps to oversee and maintain the nationwide supply of food, energy and other basic services during the 15-day lockdown, which is scheduled to begin Monday.
On Saturday, health authorities reported a surge of 2,000 new infections, the largest daily increase in Spain since the beginning of the outbreak. The numbers suggest the country is following a curve similar to that seen in Italy, which has also imposed restrictive measures on public movement.
The death toll in Spain rose to more than 190 on Saturday. Over all, 6,200 people are infected.
The more restrictive measures came after increasing alarm about the upswing in cases.
On Friday, the prime minister had warned that the number of coronavirus cases in Spain could reach 10,000 next week, given how sharply infections have been rising.
On the same day, regional officials in Catalonia declared a lockdown, telling all residents to stay at home, and the authorities in the capital, Madrid, ordered all restaurants and bars to close by Saturday. Stores in Madrid were also closed.
“We’re the new Italy,” said Francisco Gutierrez, a 33-year-old street cleaner for the city of Madrid, in an interview before the announcement of the new nationwide restrictions.
“We don’t know how long it’s going to last,” he said, “and we don’t know how much Spain will suffer from this yet.”
Even as the Spanish government has been stepping up its efforts to fight the coronavirus, its fractious politics and territorial tensions threatened to complicate its response.
Shortly after Mr. Sánchez announced the new measures, Pablo Casado, the leader of the main opposition Popular Party, made his own televised address, claiming that the government “has shown once more that it’s not up to the challenge.”
Mr. Casado lambasted Mr. Sánchez for acting late throughout the crisis, including on Saturday when the prime minister’s announcement was delayed by several hours.
On Saturday, the Madrid region, the epicenter of Spain’s coronavirus crisis, accounting for more than half of the reported cases, was already feeling the effects of restricted movement.
Madrid is normally one of Europe’s most bustling cities, with people filling its public parks and squares, or meeting for drinks and tapas in its thousands of bars and cafes.
Yet on Saturday, Madrid resembled a ghost city, as its 3.5 million residents, who normally spend much of their social life on the streets, started to follow the advice of the authorities to stay at home.
The train stations and main avenues were almost deserted, while some police cars patrolled the city center. Only stores providing basic services — such as supermarkets and gas stations — were allowed to stay open. People who ventured outside often headed to supermarkets to buy essential supplies.
Museums and other public venues closed earlier this week. The gates of Madrid’s central park, the Retiro, were shut by the police on Saturday afternoon.
On the arcaded Plaza Mayor, one of the main public spaces in the heart of the city, some tourists took a last walk as they hoped to catch a flight later in the day.
“Life here is slowing down by the hour,” said Stéphanie David, a visitor from Belgium.
The Spanish government has only once before declared a state of emergency, in 2010, when the military was ordered to break up a wildcat strike by air traffic controllers that had paralyzed the country’s airports.
A lockdown of the 7.5 million residents of Catalonia, in Spain’s northeast, was announced Friday by Quim Torra, the region’s leader, who asked the central government in Madrid to help suspend travel to and from the region by closing airports and train stations.
Mr. Torra said it was necessary to “restrict entrances and departures” from Catalonia, but such a demand could also fuel the debate over the territorial sharing of power in Spain.
On Saturday, the northern Basque region declared its own state of emergency, while the Basque regional leader, Íñigo Urkullu, warned against Madrid taking full control over policies like health care that are now under regional management.
Elsewhere in Spain, the southern city of Seville canceled its Easter celebrations, an event that attracts hundreds of thousands of visitors every year.
In the southeastern region of Murcia, the regional authorities put almost 400,000 residents of its coastal towns under lockdown, while warning visitors from Madrid and elsewhere to stop heading for the seaside and risk spreading the virus further.
Terminal 1 of Madrid’s airport was also almost empty on Saturday morning.
Among the few tourists, some said they had scrambled to rebook in order to leave Madrid earlier than scheduled, fearful that a Spanish state of emergency might close Madrid’s airport altogether, or that their airline would cancel their flight.
Victor Van Leijsen, a student from the Dutch city of Breda, was preparing to depart Madrid for Brussels, alongside his twin brother. The siblings flew to Madrid on Thursday and had planned on spending a long weekend in the Spanish capital.
“We rebooked early this morning because we were afraid we could perhaps then simply not get back,” Mr. Van Leijsen said. “We really needed a weekend off, but it unfortunately got a little shorter than we planned.”
Earlier on Saturday, as Madrid residents bought groceries and hurried back home, the authorities urged people to remain calm and maintain a one-meter distance in supermarket lines.
Yet many said they knew the worst was yet to come.
Amuda Goueli, an Egyptian entrepreneur who lives in Madrid, said Spaniards, like other Europeans, were not psychologically prepared for the coronavirus because they had not faced such a crisis in a generation.
“There has been no war, no widespread illness and a relative state of well-being despite the economic crisis,” said Mr. Goueli, wearing a mask. “So Europeans were just not ready. We don’t know how to react.”