An American Airlines employee, allegedly angry over stalled union contract talks with the company, has been accused of disabling the navigation system on a flight slated to take off from Miami over the summer, investigators said Thursday.

Abdul-Majeed Marouf Ahmed Alani, a veteran mechanic with the airline, was arrested Thursday and charged with willfully damaging, destroying or disabling an aircraft, The Miami Herald reported, citing a court affidavit.

Pilots on Flight 2834 bound for Nassau were alerted to the problem by an aircraft warning system before they took off on July 17, preventing possible injury to the 150 people on board.

EASYJET LETS PASSENGER, AN OFF-DUTY PILOT, FLY PLANE AFTER PILOT DIDN'T SHOW UP

Crews took the plane to an American Airlines hangar at Miami International Airport for routine maintenance and eventually discovered the tampering during an inspection. A mechanic found a tube underneath the cockpit that had been obstructed with foam, according to the paper.

Alani glued the foam inside the tube leading from the outside of the plane to its air data module, federal prosecutors allege. The system reports the plane's speed and other flight data.

He reportedly told federal air marshals he was angry over stalled contract negotiations between the mechanics' union and the airline, which had hurt him financially. He allegedly said he didn't mean to harm anyone on board and had tampered with the aircraft's data module to cause a "delay or have the flight canceled."

CLICK HERE TO GET THE FOX NEWS APP

Investigators said they suspected Alani after reviewing video footage. In it, he is said to be seen exiting a truck on the day of the flight and accessing the compartment where the navigation system was located.

He is expected to appear in court Friday.