NEW YORK (AP) — A New York high school student secretly pleaded guilty to federal charges accusing him of trying to join an offshoot of al-Qaida in Yemen so he could die fighting jihad, authorities said Wednesday.

In January, Justin Kaliebe told an undercover operative pretending to be a confidant, "There is no way out for me. ... The only way out is martyrdom," according to court papers.

A record of the American citizen's computer activity suggested he was influenced by the lectures of cleric Anwar al-Awlaki, the militant leader who was killed in a 2011 U.S. drone strike in Yemen, the papers said.

Counterterrorism agents intercepted the 18-year-old on Jan. 21 as he tried to board a flight to Oman at John F. Kennedy International Airport on his way to Yemen. He pleaded guilty to attempting to provide material support to a terrorist organization on Feb. 8 as part of an ongoing investigation.

The secret plea could mean the defendant was cooperating in the probe when it was at a sensitive stage. A spokesman for the U.S. attorney's office in Brooklyn declined comment.

At Kaliebe's first appearance in open court on Wednesday, a Long Island judge ordered him to undergo a psychiatric evaluation before a sentencing scheduled for Sept. 27. He didn't speak during the brief proceeding and his attorney had no comment afterward.

Authorities said Kaliebe was a high school student at the time of his arrest, claims to be of Russian descent and has addresses in the Long Island towns of Babylon and Bayshore. They provided no further details about his background.

Prosecutors allege Kaliebe began plotting to join al-Qaida on the Arabian Peninsula in the fall of 2011 while he was in email and face-to-face contact with the undercover operative, who recorded their conversations. The operative told the defendant he was from Yemen and could give him pointers on how to get there, according to a criminal complaint.

Kaliebe asked the operative "to assure him that he was not going to 'rat him out' and after the (operative) assured him that he would not, Kaliebe indicated that he wanted to join a group 'for the sake of Allah.'"

Last summer, Kaliebe was recorded saying he was saving money "as a means to go to Yemen to fight jihad," the complaint said. He also told a New York Police Department undercover officer in January that he was inspired by Awlaki and Osama bin Laden, "both who bore witness to the truth for their blood," the complaint added.