Travellers returning to the UK from Spain after midnight will have to quarantine for 14 days, the government has said.
The decision came following a spike in coronavirus cases in Spain, with more than 900 new cases of the virus reported on Friday.
Spanish officials have also warned a second wave could be imminent as major cities have seen cases surge.
The Foreign Office advises against all but essential travel to mainland Spain.
"Protecting public health is our absolute priority and we have taken this decision to limit any potential spread to the UK," a spokesman from the Department of Transport said.
"We've always been clear that we would act immediately to remove a country [from quarantine exemptions list] where necessary."
The spokesman said people currently on holiday in Spain should follow the local rules, return home as normal, and check the Foreign Office's travel advice website for further information.
The quarantine measures will apply to those returning from mainland Spain, the Canary Islands and the Balearic Islands, such as Palma and Ibiza. However, Foreign Office advice against non-essential travel, which has ramifications for travel insurance, only applies to mainland Spain.
Among those affected is Transport Secretary Grant Shapps, who began his holiday in Spain on Saturday. He is expected to continue his trip as planned and isolate in line with guidance on his return.
The government is urging employers to be "understanding of those returning from Spain who now will need to self-isolate".
But Labour's shadow home secretary Nick Thomas-Symonds called for the government to explain in detail how it would support those affected, adding that the news would be "deeply concerning for families who are in caught in Spain or are planning travel".
Scottish First Minister Nicola Sturgeon tweeted that the decision was made after reviewing the latest data earlier on Saturday.
"This reinforces the point that these matters are subject to change at short notice and so my advice is to be cautious about non-essential foreign travel," she said.
What's happening in Spain?
Spain has so far seen more than 28,000 coronavirus deaths. On Thursday, it saw the biggest daily increase in infections since its lockdown ended.
Catalonia has become the latest region to crack down on nightlife. The wealthy north-east region, which is home to Barcelona, ordered all nightclubs to close for two weeks and put a midnight curfew on bars in the greater Barcelona area.
The BBC's Guy Hedgecoe in Madrid says contagion among young people is a particular worry, as they have been gathering in large numbers in cities at night.
France has warned its citizens not to travel to Catalonia while Norway has said it will start quarantining people arriving from Spain.
Quarantine measures for UK travellers were introduced in early June. But after pressure from the aviation and travel industries, the government and devolved administrations published lists of countries exempt from the rules.
The Airport Operators Association said the new measures would "further damage what is already a fragile restart of the aviation sector which continues to face the biggest challenge in its history".
Budget airline EasyJet said it was "disappointed" and would operate a full schedule in the coming days.
"Customers who no longer wish to travel can transfer their flights without a change fee or receive a voucher for the value of the booking," the company said in a statement.
However, the UK's biggest tour operator, Tui, cancelled its flights due to depart to mainland Spain and the Canary Islands on Sunday. Customers currently on holiday will be able to return on their intended flight home.
A spokesman for the Association of British Travel Agents (Abta) said the government's quarantine rule change was "disappointing".
"We suggest the government considers lifting the quarantine rules for flights to and from certain regions with lower infection rates, or to places such as the Balearic Islands or the Canaries - which are geographically distinct from mainland Spain - to avoid further damage to the UK inbound and outbound tourism industries," he said.
The new rules for Spain come a day after five other destinations were added to England's quarantine-free list.
Anyone coming to England from Estonia, Latvia, Slovakia, Slovenia and St Vincent and the Grenadines will not have to isolate for two weeks on arrival, the government confirmed on Friday.
John Blackmore, from Hampshire, was due to fly out to his family in Spain with his wife and two young children. But the new rules mean he has had to cancel, for fears his wife's employer would not be able to accommodate her taking an extra two weeks off to quarantine on their return.
He said he thought it was unlikely they would get a refund for the flight, as it has not been cancelled.
"I'm devastated," he told the BBC. "I have family in Spain who haven't seen their only grandkids since Christmas."
Lois Stothard, from South Yorkshire, told the BBC she had booked a holiday to Seville as a surprise for her boyfriend's 30th birthday - due to fly out on Sunday morning - but now feels that she cannot travel.
"I'm a keyworker - I'm a teacher - and my boyfriend has work commitments so we cannot quarantine for 14 days when we return," she said.
"We can't get any money back and to change the company want double what I've already paid in fees. I'm very disappointed and upset as we're packed and ready to go."