Madrid, Spain (CNN) -- The Spanish government put the military in control of air space late Friday to get commercial jets flying again after a surprise air traffic controller strike stranded tens of thousands of travelers, the deputy prime minister announced.

"The prime minister has signed an order giving the Ministry of Defense control of air space in the whole nation until there are guarantees that (civilian) air traffic controllers will provide normal service," Deputy Prime Minister Alfredo Perez Rubalcaba announced in a nationally televised statement.

He said the measure was taken because of the "extraordinary circumstance of the closure of air space, provoked by the air traffic controllers" and added the government is acting in accord with "the Constitution and existing legislation."

Many of the stranded passengers sent twitters or called in to newsrooms describing how they were stuck on planes on airport tarmacs. This included families with young children trying to set off on a vacation over the long holiday that continues in Spain through next Wednesday.

CNN affiliate CNN+ reported that military officers had moved to take control at towers at 10 airports before midnight. There are about 47 airports in Spain.

The months-long dispute between the government and the air traffic controllers over conditions and pay reached a climax around 5 p.m. (11 a.m. ET) on Friday when controllers at airports in Madrid and Spain's Balearic Islands in the Mediterranean walked off en masse.

Just a few remained to guide a some remaining planes in the air toward safe landings, officials said.

The wildcat strike soon spread to most airports across the nation, affecting hundreds of flights.

The airport authority AENA estimated up to 250,000 people might be affected, including those at airports and those waiting to go on flights that would be delayed or canceled. AENA advised travelers to stay away from airports until they were sure their flights would take off.

The prime minister's Cabinet earlier Friday approved a measure regulating the controllers' shifts and work conditions. In addition, the new rules allow the government to put the military in control of air space in case of a wildcat air controller strike.

As the strike carried on late Friday, the government assessed whether controllers were showing up for the late shifts, a senior aide to Prime Minister Jose Luis Rodriguez Zapatero told CNN.

When it was determined the controllers were not returning in significant numbers, except at Barcelona's airport, Zapatero signed the order giving the military control, and the deputy prime minister announced it soon after.

Many people holding tickets on the commercial flights scheduled for Friday afternoon and evening said they had little hope of getting out, since Saturday flights were expected to be fully booked for the long holiday.

The government apologized for the inconvenience to travelers in repeated statements and added extra trains from the state-run railway, but not enough to handle everyone who was stranded at airports.

CNN+ reported the government was holding a crisis meeting over the walkout and leaders of the air traffic controllers union were headed to the meeting for talks with the government.

At a news conference, AENA President Juan Ignacio Lema apologized to Spaniards for the disruptions.

"This irresponsible decision is provoking grave consequences across Spain," he said. "It could lead to firing and could be a crime under the criminal code for abandoning a post for unjustified reasons."

He called on controllers "to immediately return to work and stop holding Spaniards as hostages."

Lema added that since many controllers had alleged medical reasons for leaving their posts, AENA was sending doctors to the airports to attempt to verify the medical conditions of those controllers.

Concha Garcia Campoy, a Cuatro television show host and journalist, said she and her family were stuck aboard a plane on the tarmac at the Madrid airport.

"We entered the plane at 4:50 p.m.," Garcia Campoy told CNN+ by phone at 7 p.m. (1 p.m. ET). "We were going to London. The plane is full of families and children."