(NEXSTAR) – Passengers aboard a recent American Airlines flight were delayed for several hours at Charlotte Douglas International Airport amid mechanical and weather-related issues. The flight, which was scheduled to leave for New York at 1:07 p.m. on July 24, didn’t depart until shortly after 7 p.m. that evening, and only after passengers were transferred to another plane, American Airlines confirmed.

Some passengers had complained of limited air conditioning or beverages during the nearly six-hour delay, the Charlotte Observer reported. One passenger, herself a Charlotte Observer reporter, claimed another traveler began “having a mental breakdown” during the wait and that some people had even “started sobbing.”

American Airlines issued a statement acknowledging the frustrating situation, but as far as the Federal Aviation Administration is concerned, the carrier appeared to abide by all rules and regulations for passengers awaiting takeoff.

According to the Department of Transportation, airlines are allowed to keep passengers on a departing flight for up to three hours (or four for an international flight) before they are required to start moving the plane “to a location where passengers can safely get off.” There are exceptions, of course, which are allowed “only for safety, security, or air traffic control-related reasons.”

In the case of last Sunday’s American Airlines flight, which was initially delayed after the flight crew detected a maintenance issue, the plane’s passengers were instructed to deplane at 3:50 p.m. After 40 minutes in the terminal, customers were transferred to a different plane, which began boarding at 4:30 p.m. but didn’t take off for New York until 7:03 p.m. due to lightning in the area, according to American Airlines.

American also claims that, for the majority of the delays, the plane was sitting at the gate with the jetbridge attached and the forward cabin door open for any passengers who wished to leave.

Because of this, a representative for American Airlines told Nexstar the incident didn’t officially qualify for the Department of Transportation’s definition of a “tarmac delay,” which only begins when the boarding doors are closed. Instead, a representative for the carrier referred to Sunday’s incident as an “extended gate delay.”

If this was a tarmac delay, however, the Department of Transportation explicitly states that passengers who choose to leave the plane could also be refused re-entry: Airlines are in no way required to let them back on the plane, and they may not even offload those passengers’ checked baggage.

“Passengers will need to contact the airline about returning their checked luggage at a later time,” the Department of Transportation writes.

As for food and beverages during tarmac delays, passengers are entitled to a drink and a snack (“such as a granola bar”) within two hours after the start of the delay, barring any significant safety or security reasons.

But what if your plane isn’t parked at the gate and it hasn’t yet been three hours (or four, for international flights) since the delay began? What happens if passengers begin requesting to be let off the plane? In that case, it’s usually up to the airline whether the aircraft can return to the gate and deplane passengers.

Many different agencies — Air Traffic Control, the Transportation Security Administration, Customs and Border Protection (CBP) — can elect to allow a plane to disembark, depending on whether the aircraft is arriving (from a domestic or international location) or waiting to depart. But if the plane is simply waiting on the tarmac and there is no threat to the safety or security of passengers, the airline is generally in charge of deciding whether to deplane earlier than the required time frame.

A representative for Customs and Border Protection told Nexstar that CBP officials, too, can choose to contact the airline and begin facilitating the deplaning of an aircraft if circumstances necessitate it.

Each U.S. airline, meanwhile, is required by law to establish a Contingency Plan for Lengthy Tarmac Delays, to address passenger needs and rights. In the case of American’s Contingency Plan, all rules for tarmac delays appear as if they were followed during Sunday’s extended gate delay. Though, if the plane wasn’t parked at the gate with the door open — and the incident actually did qualify as a tarmac delay — the Charlotte Observer reporter, mentioned earlier, might feel warranted in arguing about the cabin temperature.

“We know it can be frustrating when travel doesn’t go as planned, and apologize to our customers for the inconvenience,” American wrote in a statement shared with Nexstar.