The pilot, Libertad Salmeron, acknowledged in interviews that she broke the "sterile cabin" guidelines, but insisted she had asked her superior for permission to record the video and warned the pilots involved in the near-crash that the runway at Benito Juarez International Airport was occupied.

The video, which Salmeron said she recorded as she was waiting on one runway to take off, shows a Volaris plane coming close to landing on top of another plane.

"Volaris ended its working relationship with First Official Salmeron for not guaranteeing the fulfillment of sterile cabin procedures and the... care of our clients," the airline said in a statement.

Sterile cabin procedures apply to anything below 10,000 feet, said independent aviation analyst Jose Suarez. Pilots are only allowed to focus on the task at hand to limit distractions, he said.

However, Suarez added the rule is frequently broken, noting Salmeron had her plane's brakes in place, meaning she posed no risk.

Volaris "is looking for a reason to justify the firing of this pilot," Suarez said. "Yes, there's the issue of 'sterile cabin,' but the real question is, is that really why she lost her job?"

Pilots union ASPA, which represents workers at rival airline Aeromexico, said in a statement it was "worried" about Salmeron's firing and that she had subsequently joined the union.

Aeromexico declined to confirm whether Salmeron had since joined the company.

(Reporting by Kylie Madry; Editing by Josie Kao)