An American Airlines mechanic on Friday was due to appear in court on charges he tampered with an aircraft over stalled union negotiations that he said harmed him financially.

US prosecutors have charged Abdul-Majeed Marouf Ahmed Alani with interfering with part of an aircraft fight data system, causing the grounding of a July flight from Miami to the Bahamas, according to a criminal complaint filed Thursday in Miami.

Alani is due to appear before a judge later Friday. The maximum possible penalty for the violation is 20 years in jail, said a spokeswoman for the US Attorney's Office in Miami.

The plane carrying 150 passengers and crew was taken out of service before takeoff due to an error in the air data module system.

Alani was identified in surveillance footage as having entered the aircraft earlier in the morning.

Alani allegedly admitted to the FBI that he had inserted a piece of foam into the ADM inlet and applied super glue to prevent the foam from coming off, according to an FBI affidavit.

"Alani explained to law enforcement that he was upset at the stalled contract dispute between the union workers and American Airlines and that this dispute had affected him financially," the affidavit said.

Alani said he tampered with the plane "to cause a delay or have the flight canceled in anticipation of obtaining overtime work."

American has been embroiled in contentious labor negotiations and litigation with its mechanics union that led to flight cancelations and delays in the second quarter.

The US carrier said it immediately notified investigators following the incident and cooperated with the probe.

"At American we have an unwavering commitment to the safety and security of our customers and team members," the company said.

"At the time of the incident, the aircraft was taken out of service, maintenance was performed and after an inspection to ensure it was safe the aircraft was returned to service."

The union, the TWU/IAM Association, said it "condemns in the strongest possible terms any conduct by any individual that jeopardizes the safe operation of an aircraft."