Spirit Airlines Inc passengers are held back by law enforcement officers after several flights were cancelled at Fort Lauderdale-Hollywood International Airport in Florida, U.S., May 9, 2017. Courtesy of Jary Romero/Handout via REUTERS

(Reuters) - Spirit Airlines Inc SAVE.O said on Thursday it had reached a deal with an airline pilots union to extend indefinitely a temporary restraining order issued by a U.S. court directing its pilots to return to work after a labor dispute.

The budget carrier has canceled several flights over the past few days, following what it called “illegal work slowdown by its pilots”.

On Monday, Spirit Airlines passengers brawled in a Florida airport after the carrier canceled flights due to the work slowdown.

On Tuesday, a court issued a temporary restraining order forcing the airlines’ union pilots to return to work.

The order will remain in effect until a collective bargaining agreement is signed and ratified by its pilots represented by the Air Line Pilots Association International, the Florida-based carrier said on Thursday.

If required, the order could remain in effect until the parties are released from mediation by the National Mediation Board, the company said.