It means those returning from the country will have to self-isolate for two weeks upon their return to the UK. Here is what it means for holidaymakers:
When will holidaymakers have to self-isolate?
The measures came into effect from midnight, meaning that from Sunday all returning travellers will be have to isolate for 14 days.
The quarantine applies to people returning to any of the four nations of the UK - England, Scotland, Wales and Northern Ireland.
Why is it being brought in now?
The Government said the move follows a "significant change" over the last week in both the level and pace of change in confirmed cases of Covid-19 in Spain.
On Thursday, the Spanish health ministry reported 971 new daily infections, the biggest daily increase since Spain's lockdown ended.
Catalonia became the latest region to crack down on nightlife, trying to halt new infection clusters.
The wealthy north-east region - home to Barcelona - ordered all nightclubs to close for 15 days and put a midnight curfew on bars in the greater Barcelona area and other towns around Lleida that have become contagion hot zones.
What should people do if they are already in Spain?
People currently on holiday in Spain have been encouraged to follow the local rules, return home as normal and check the Foreign and Commonwealth Office's (FCO) travel advice pages on gov.uk for further information.
The FCO is not advising those already travelling in Spain to leave at this time.
What should holidaymakers do if they have a holiday booked to Spain? The FCO is advising against all but essential travel to mainland Spain.
Abta - the UK's travel trade association - has advised customers due to travel to the country imminently to contact their travel provider.
Holiday operator Tui has said it will cancel all planned holidays to Spain in response to the announcement and customers will be contacted to discuss options.
Meanwhile, airline easyJet said it planned to operate its full schedule in the coming days.
A spokeswoman said: "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.
"Should any flights be cancelled for later in August customers will be notified and informed of their options which includes transferring to an alternative flight free of charge, receiving a voucher or applying for a refund."
Does the quarantine apply if the holidaymaker has been to a Spanish island?
Quarantine measures will apply to those returning from mainland Spain, the Canary Islands (Tenerife, Fuerteventura, Gran Canaria, Lanzarote, La Palma, La Gomera, El Hierro and La Graciosa) and the Balearic Islands, such as Mallorca and Ibiza, the Department for Transport confirmed.