A New York man sought to join an al-Qaida group in Yemen, conspired to commit murders overseas and tried to destroy computer hard drives when he realized he was under investigation, authorities said after his arrest Friday.

Marcos Alonso Zea, 25, pleaded not guilty and was detained without bail after his morning arrest at his home in Brentwood, on Long Island. He was charged with conspiracy to commit murder in a foreign country, attempting to support terrorists and al-Qaida in the Arabian Peninsula, and obstruction of justice.

Federal prosecutors accused Zea of planning to travel overseas to wage violent jihad on the perceived enemies of Islam, including Yemen’s secular government.

They said he flew to London en route to Yemen in January to join Ansar al-Sharia, which the U.S. has declared an alias for al-Qaida in the Arabian Peninsula, but he was rejected by customs officials in the United Kingdom and returned to the United States.

“Despite being born and raised in the United States, Zea allegedly betrayed his country and attempted to travel to Yemen in order to join a terrorist organization and commit murder,” U.S. Attorney Loretta E. Lynch said.

Once home, Zea continued participating in the conspiracy, providing money and instructing co-conspirator Justin Kaliebe on how to evade electronic surveillance by law enforcement as he discussed Kaliebe’s plans to fight jihad, according to court papers.

Zea was inspired by terrorist propaganda, said George Venizelos, head of the FBI’s New York office.

Among the violent Islamic extremist materials found on Zea’s computer, authorities said, were issues of an al-Qaida publication that promotes violent jihad. The publication contained articles such as “Which is Better: Martyrdom or Victory?” ”Why did I choose al Qaeda?” and “What to Expect in Jihad.”

Investigators said they also found an al-Qaida-produced video depicting detonation of an explosive device on a vehicle carrying western military personnel.

Sally Butler, Zea’s lawyer at an arraignment in federal court, declined to comment afterward. Zea’s parents, who attended the court proceeding, said he worked as a clerk at a home improvement store in Huntington. Zea nodded toward them as he was led into court.

After learning he was under investigation, Zea directed an associate to erase a hard drive on his home computer and gave an associate two more hard drives to destroy, though investigators recovered them anyway, authorities said.

Lynch said once investigators were on his trail, Zea “engaged in a desperate effort to cover his tracks by attempting to destroy evidence — a tactic that only confirmed his violent aims.”

Kaliebe, who was arrested in January as he tried to board a plane in New York to go to Yemen, has pleaded guilty to attempting to provide support to terrorists and attempting to provide material support. He told a judge at his plea hearing that he had brought money to give to the al-Qaida group and he had discussed with others his desire to support the group by “providing money, equipment and ourselves.” A prosecutor said the government had audio recordings of Kaliebe expressing his desire to join al-Qaida in Yemen.

He awaits sentencing in December.

In a statement, U.S. Rep. Peter King, R-N.Y., called the arrest “a vivid reminder of the threat we continue to face from domestic Islamic terrorists.”