An American Airlines mechanic based at Miami International Airport was arrested on Thursday on a charge that he sabotaged the navigation equipment of a flight carrying 150 people, forcing it to be grounded just before takeoff, the authorities said.

The mechanic, Abdul-Majeed Marouf Ahmed Alani, 60, of Tracy, Calif., told investigators on Thursday that he had tampered with the air data module system on Flight 2834 from Miami to Nassau in the Bahamas on July 17 because he was disgruntled about an impasse over a union contract, according to a criminal complaint filed in federal court.

The equipment, which is housed in a compartment beneath the cockpit and near the nose landing gear, keeps track of an aircraft’s speed and pitch as well as other critical flight data.

As the Boeing 737-800 was approaching the departure runway and powering up its engines, the crew got an error message and aborted the takeoff, the authorities said.