The northwestern Spanish region of Galicia has imposed restrictions on about 70,000 people following a Covid-19 outbreak.
It comes a day after Catalonia also introduced a local lockdown to curb the spread of the coronavirus.
People living in A Marina along Spain's northern coast in the province of Lugo will not be able to leave the area from midnight until Friday, two days before regional elections in Galicia on 12 July.
Prime Minister Pedro Sanchez, speaking at a political rally in Bilbao, urged people not to lower their guard.
But he called for calm as "the early detection of these outbreaks shows the health system is much better prepared" than in March.
The regional government in Galicia said people will be allowed to move around A Marina, but only those who need to travel for work will be allowed to leave or enter the area.
Regional Health minister Jesus Vazquez Almuina told a news conference that the biggest outbreaks were linked to several bars in the area.
Regional health authorities said there were now 258 cases in Galicia, of which 117 were in Lugo.
Capacity in bars and restaurants will be reduced to 50% and people will have to wear a face mask even if outdoors on beaches or at swimming pools, the authorities said.
Spain's Health Minister Salvador Illa said that the ministry was following the situations in Galicia and Catalonia very closely.
"Social distancing and lockdown measures were the key to flattening the curve. Now they are needed again to stop the outbreaks," he said in tweet.
Spain has registered 205,545 coronavirus cases and 28,385 deaths according to health ministry data, making it one of Europe's worst-affected countries.