Airport Security and a Broward Sherriff's Deputy keep an eye on the line at Spirit Airlines, Tuesday, May 9, 2017, at the Fort Lauderdale-Hollywood International Airport in Fort Lauderdale, Fla. Skirmishes involving irate passengers broke out at the Florida airport Monday following the cancellation of multiple Spirit Airlines flights. (Joe Cavaretta/South Florida Sun-Sentinel via AP)
Airport Security and a Broward Sherriff's Deputy keep an eye on the line at Spirit Airlines, Tuesday, May 9, 2017, at the Fort Lauderdale-Hollywood International Airport in Fort Lauderdale, Fla. Skirmishes involving irate passengers broke out at the Florida airport Monday following the cancellation of multiple Spirit Airlines flights. (Joe Cavaretta/South Florida Sun-Sentinel via AP) Credit: JOE CAVARETTA

A federal court granted Spirit Airlines a temporary restraining order on Tuesday, compelling the pilots’ union to return to status quo after what the airline says has been “a pervasive illegal work slowdown” that caused hundreds of flight cancellations and disrupted travel for more than 20,000 passengers in the past week.

The pilots union said Spirit Airlines pilots will fully comply with the court to help restore normal operations.

“We are hopeful that we can put this moment behind us and get back to serving our customers,” Spirit Airlines spokesman Paul Berry said in a statement.

The U.S. District Court ruling comes a day after anger and confusion boiled over at Fort Lauderdale-Hollywood International Airport on Monday night as nine Spirit Airlines flights were canceled, leaving hundreds of passengers stranded, according to airport officials.

What followed was chaos as frustrated passengers clashed with Spirit employees, and law enforcement officers tried to maintain order.

Video from the Florida airport showed crowds clustered around Spirit Airlines ticket counters, with people pushing, screaming and cursing.

At one point in one of the videos, the stanchions holding in the line were knocked over, and a Broward County (Fla.) sheriff’s deputy was shoved to the ground. Sheriff’s deputies detained three passengers and charged them with disorderly conduct, according to arrest reports.

The flight cancellations were reportedly the result of a legal dispute between the budget airline and the Air Line Pilots Association International.

In a statement to The Washington Post, Spirit Airlines blamed its pilots for the cancellations and the resulting chaos. About 300 Spirit Airlines flights have been canceled in the past week, according to a lawsuit Spirit lawsuit filed against ALPA on Monday.

ALPA disputed the airline’s accusations. But on Tuesday afternoon it said Spirit pilots “are committed to helping impacted passengers and the company restore normal operations.

“The court has spoken and Spirit pilots will fully comply with the order handed down, which is completely in line with our overriding goal: the resumption of normal operations. We call on the company to join forces with ALPA and the Spirit pilots to do just that,” ALPA said in a statement.

The pilot actions have impacted about 15 percent of flights across the network, Spirit said. The U.S. District Court in South Florida has scheduled a May 15 hearing for a preliminary injunction.

“We sincerely apologize to our customers for the disruption and inconveniences they have suffered,” Berry said. “We believe this is the result of intimidation tactics by a limited number of our pilots affecting the behavior of the larger group.”

Authorities say the behavior of a few passengers at Fort Lauderdale on Monday night caused a crowd of about 500 people to “become enraged, fearful or visually upset.” The incident, an arrest report said, “resembled the start of a riot.”

One of the passengers became “increasingly aggressive to the point of near violence” toward an airline employee, according to the arrest report. The passenger then “challenged deputies with threatened physical violence,” the report said.

“We are shocked and saddened to see the videos of what took place at Ft. Lauderdale/Hollywood International Airport,” Berry said. “This is a result of unlawful labor activity by some Spirit pilots designed to disrupt Spirit operations for our customers, by canceling multiple flights across our network. These pilots have put their quest for a new contract ahead of getting customers to their destinations and the safety of their fellow Spirit Team Members.”

Berry said the airline had filed a federal lawsuit on Monday against the pilots union and others for “purposely and unlawfully disrupting the airline’s operations, leading to hundreds of canceled flights, which has negatively impacted thousands of Spirit customers’ travel plans.”

“So we reluctantly filed this suit to protect our customers and our operations,” Berry said. “This is clearly unlawful activity under the Railway Labor Act, which governs labor relations in the airline industry. ALPA and those individuals responsible should be held accountable.”

ALPA said earlier on Tuesday that the two are “not engaged in a job action.”

Spirit flight cancellations continued for the third day in a row on Tuesday at Fort Lauderdale, airport officials said. The airport had long lines all day on Monday, as many travelers whose flights were canceled on Sunday were trying to get on already full flights.