BARCELONA, Spain (AP) — Impromptu street celebrations erupted across Spain as the clock struck midnight on Saturday, when a six-month-long national state of emergency to contain the spread of coronavirus ended and many nighttime curfews were lifted.

In Madrid, police had to usher revelers out of the central Puerta del Sol square, where the scenes of unmasked dancing and group singing resembled pre-pandemic nightlife.

Teenagers and young adults also poured into central squares and beaches of Barcelona to mark the relaxation of restrictions.

“Freedom!” said Juan Cadavid, who was reconnecting with friends. “(It’s) a bit scary, you know, because of COVID, but I want to feel like this around a lot of people.”

People crowded and dance on the beach in Barcelona, Spain, Sunday, May 9, 2021. Barcelona residents were euphoric as the clock stroke midnight, ending a six-month-long national state of emergency and consequently, the local curfew. Spain is relaxing overall measures to contain the coronavirus this weekend, allowing residents to travel across regions, but some regional chiefs are complaining that a patchwork of approaches will replace the six-month-long national state of emergency that ends at midnight on Saturday. (AP Photo/Emilio Morenatti)

The 25-year-old Barcelona resident was also rejoicing at the prospect of going back to work at a Michelin-star restaurant that has been closed for the past seven months due to pandemic-related restrictions.

Local restaurants will be able to serve dinner again beginning Sunday and can stay open until 11 p.m. But a limit of four people per table remains and indoor dining is limited to 30% of capacity.

With the end of the state of emergency, bans on traveling across Spain’s regions have also been lifted and many curbs on social gatherings were relaxed. Only four of the country’s 19 regions and autonomous cities are keeping curfews in place.

Police officers stand guard as people crowded on the beach in Barcelona, Spain, Sunday, May 9, 2021. Barcelona residents were euphoric as the clock stroke midnight, ending a six-month-long national state of emergency and consequently, the local curfew. Spain is relaxing overall measures to contain the coronavirus this weekend, allowing residents to travel across regions, but some regional chiefs are complaining that a patchwork of approaches will replace the six-month-long national state of emergency that ends at midnight on Saturday. (AP Photo/Emilio Morenatti)

In spite of criticism from some regional chiefs and opposition figures, Spain’s center-left ruling coalition refused to extend the state of emergency, which provided a legal umbrella to enact sweeping anti-COVID-19 measures restricting fundamental freedoms.

Prime Minister Pedro Sánchez has said existing regulations should be enough to respond to outbreaks at the regional level as the rollout of vaccines is speeding up.

Spain’s number of new coronavirus infections in the past 14 days fell Friday to 198 new cases per 100,000 residents, although the central Madrid and the northern Basque regions have more than twice that rate. Hospital occupation levels remain high, however, with more than 1 in 5 intensive-care beds in the country treating COVID-19 patients.

People crowded and dance on the beach in Barcelona, Spain, Sunday, May 9, 2021. Barcelona residents were euphoric as the clock stroke midnight, ending a six-month-long national state of emergency and consequently, the local curfew. Spain is relaxing overall measures to contain the coronavirus this weekend, allowing residents to travel across regions, but some regional chiefs are complaining that a patchwork of approaches will replace the six-month-long national state of emergency that ends at midnight on Saturday. (AP Photo/Emilio Morenatti)