An American Airlines mechanic was arrested on Thursday on suspicion of sabotaging a plane in Miami this summer, according to a criminal complaint obtained by Business Insider.

The mechanic glued a hard foam material inside a tube leading to the plane's air-data module, which measures air speed, pitch, and other crucial flight information. The pilots aborted takeoff when they noticed an error message.

He said that he was upset over stalled labor contract negotiations between the airline and the union, and was trying to get the flight canceled so he could work overtime.

The airline and union have been locked in a contentious dispute all summer, with the airline accusing mechanics of an illegal organized work slowdown, saying it caused performance issues this summer.

Visit Business Insider's homepage for more stories.

A mechanic for American Airlines was arrested in Miami on Thursday on a sabotage charge after he was accused of tampering with a plane because he was upset over stalled union contract negotiations.

The mechanic, named Abdul-Majeed Marouf Ahmed Alani, according to a criminal complaint filed in a Miami federal court and obtained by Business Insider, is accused with tampering with an aircraft's air-data module.

According to the complaint, Alani is suspected of gluing a hard foam substance inside a tube that connected a sensor on the nose of the airplane — called "pitot tubes" or static ports — with a computerized system — the air-data module, or "ADM" — that reads air pressure from the sensor and computes the aircraft's air speed, along with other information like pitch.

The July 17 flight, AA2834 to Nassau, Bahamas, never took off, and no one on the plane was injured. As pilots powered up the thrusters on the runway in Miami, they received an error alert from the ADM, leading them to abort the takeoff.

Te plane — a Boeing 737-800, according to data from FlightRadar24 — was taken out of service for maintenance, according to the criminal complaint. During an inspection, a different mechanic found the obstructed tube.

Alani is charged with "willfully damaging, destroying or disabling an aircraft." He's expected to appear in Miami federal court on Friday. The charge carries a penalty of up to 20 years in prison, if convicted.

Read more: These were the most delayed airports in the US this summer

After he was arrested, Alani said that he was not trying to hurt anyone on board the plane or cause lasting damage to the aircraft, according to the criminal complaint.

Instead, the alleged act of sabotage was because Alani was "upset" over stalled contract negotiations between American Airlines and its mechanics' labor unions. He claimed that "the dispute had affected him financially," and that his objective was to cause "to cause a delay or have the flight canceled in anticipation of obtaining overtime work."

Alani was arrested by federal air marshals working as part of the FBI's Joint Terrorism Task Force.

American Airlines has been locked in a contentious battle this summer over stalled contract negotiations with the union representing its mechanics, the TWU-IAM Association — which is formed of the Transport Workers Union of America (TWU) and the International Association of Machinists and Aerospace Workers (IAM). The union represents a total of 30,000 ground workers at American Airlines.

The airline accused the union of organizing an illegal work slowdown, and filed a lawsuit in May seeking a permanent injunction against the mechanics — the court ruled for American in August. The unions denied that there was an organized slowdown, but nevertheless urged employees to abide by the ruling.

The airline has been negotiating with mechanics since December 2015, but talks stalled and there has not been a meeting between the airline and unions since April.

See also: Apply here to attend IGNITION: Transportation, an event focused on the future of transportation, in San Francisco on October 22.

On Wednesday, TWU-IAM announced that it was resuming contract negotiations with American later this month at the National Mediation Board in Washington, DC.

"The delays in this process have been frustrating for our members but they have remained fully supportive of the Association," Alex Garcia, vice director of the TWU-IAM Association, in a press release announcing the new round of negotiations. "We will use this opportunity to finally close these negotiations, if American Airlines is a willing partner."

TWU-IAM did not immediately return a request for comment regarding Alani's arrest.

In a statement, American Airlines said that it was cooperating with the federal investigation:

On July 17, flight 2834 from Miami to Nassau, Bahamas, returned to the gate due to a maintenance issue. Passengers boarded a new aircraft which then re-departed for Nassau. At American we have an unwavering commitment to the safety and security of our customers and team members and we are taking this matter very seriously. 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. American immediately notified federal law enforcement who took over the investigation with our full cooperation.

The FBI declined a request for comment on Thursday night.

Read the full criminal complaint against Alani below: