A federal judge denied bail on Wednesday to a former American Airlines mechanic who is accused of sabotaging a plane carrying 150 people in Miami in July, saying the mechanic may be “sympathetic to terrorists.”

The mechanic, Abdul-Majeed Marouf Ahmed Alani, 60, admitted to federal agents that he tampered with the Boeing 737-800 at Miami International Airport on July 17, forcing the plane to be grounded before takeoff, according to court records. He said he was upset about an impasse over a union contract and wanted the flight to be delayed or canceled so he could get overtime work.

He was arrested on Sept. 5 and charged with willfully damaging, destroying or disabling an aircraft and could face up to 20 years in prison if convicted.

At a bail hearing Wednesday, prosecutors argued that Mr. Alani, of Tracy, Calif., had videos on his cellphone that showed mass murders committed by the Islamic State, The Associated Press reported. Prosecutors also noted that Mr. Alani had said that he wished that Allah would harm non-Muslims and that he has a brother who lives in Iraq who may be involved with ISIS.