(CNN) A mechanic for American Airlines appeared in court Friday after he was accused of trying to sabotage a commercial airliner shortly before it was set to take off from Miami International Airport for the Bahamas with 150 people on board.

Abdul-Majeed Marouf Ahmed Alani has been charged with "willfully damaging, destroying, disabling, or wrecking an aircraft, and attempting to do so," according to a criminal complaint filed in federal court.

Alani allegedly tried to damage or disable the aircraft's air data module (ADM) system, which reports aircraft speed, pitch and other critical data, on July 17.

On Thursday, investigators interviewed Alani and he "admitted that he accessed the ADM" and that he "inserted a piece of foam into the ADM's inlet where the line connects and that he applied super glue to the foam so as to prevent the foam from coming off," the complaint says.

"Alani stated that his intention was not to cause harm to the aircraft or its passengers," investigators say in the complaint.

Read More