Flights from Spain resumed tonight after wildcat strikes by air traffic controllers caused travel chaos and left thousands of British passengers stranded overseas.

The controllers launched their unofficial action in a row over pay and conditions, leading the Spanish government to declare a state of alarm.

Workers returned to their shifts after being threatened with jail terms, but officials say it could take up to 48 hours before flights return to normal.

Dozens of services to and from UK airports were grounded as Spanish air space was closed, with Ryanair, easyJet and Iberia all cancelling flights.

Transport minister Philip Hammond said there had been no advance warning of the strikes, which left hundreds of thousands of tourists, many of them British, stranded.

The industrial action came in the week that cold weather had caused transport systems in the UK to grind to a halt, closing some airports.

Gatwick Airport said 40 flights had been cancelled by midday, and Heathrow Airport also said it had suffered disruption due to the action. In Manchester, 10 flights were cancelled, with a further 16 outbound flights failing to leave Liverpool John Lennon Airport.

Passengers were advised to stay away from airports unless they had contacted their airline.

By this evening, a handful of flights had resumed at airports including Madrid, Bilbao and Las Palmas in the Canary Islands, Spanish civil aviation authority Aena said.

Spain's development minister Jose Blanco said it would take some time to return to normal flight schedules.

He added: "We think that in 24 to 48 hours we can be back to normal if the air traffic controllers comply with the order and all of them work in line with their obligations."

Many people were forced to sleep at airports across Spain on Friday night and throughout today, with police providing blankets to keep them warm.

A Department for Transport spokeswoman said: "The Government is very concerned for passengers who have been affected by the unofficial industrial action by air traffic controllers in Spain.

"Nats (National Air Traffic Services) and the Civil Aviation Authority have been in contact with the Spanish authorities to offer any help they can give.

"Airlines and tour operators have a legal duty to provide assistance to passengers in these circumstances and anyone affected should contact their airline or tour operator.

"We understand that most flights to or from Spain have been cancelled today and we recommend that anyone planning to travel contacts their airline before going to the airport.

"The Transport Secretary is pleased to hear reports from the Spanish air traffic control agency Aena that their airspace has now re-opened. He hopes airlines can clear the backlog and return to normal quickly."

Spanish deputy prime minister Alfredo Perez Rubalcaba apologised to the travellers affected and accused air traffic controllers of "blackmailing all of our citizens."

The state of alarm clause, created to help governments deal with catastrophes including earthquakes, floods, and the collapse of public services, had never previously been used in Spain.

The strike, falling on a long weekend in Spain, was launched after the government slashed the overtime allowance of air traffic controllers.

The situation appears to have been exacerbated by a decree approved by the cabinet yesterday, under which controllers who miss work shifts because of illness must make up lost hours and can be subject to medical check-ups immediately if they call in sick.

A Foreign Office spokesman said: "We strongly advise anyone planning to fly this weekend, either to or from Spain, to contact their airline or travel operator before travelling to the airport.

"Our consular staff in Spain will continue to monitor the situation very closely over the next few days and offer support to affected British nationals where it is needed."

Customers who were yet to travel to Spain were given the option to rebook their flights or offered a refund if their flight was cancelled, with tour operators making efforts to reschedule flights for those on package holidays.