NEWARK, N.J. — Two U.S. citizens pleaded guilty Thursday to charges that they tried to join an al-Qaida-affiliated group overseas.

Mohamed Alessa and Carlos Eduardo Almonte, known as Omar, entered into a packaged plea deal in a Newark federal courtroom Thursday.

They each pleaded guilty to an information count charging them with conspiring within the United States to murder individuals outside the U.S. by trying to join al-Shabab, a designated terrorist organization.

The two were arrested in June at New York's Kennedy Airport as they prepared to board separate planes to Egypt. From there, the men admitted Thursday, they had planned to travel to Somalia to seek terror training from al-Qaida-affiliated jihadists. The men had no contact with Somali terrorists but hoped they would be accepted by a terrorist group, according to officials and court documents.

The 21-year-old Alessa, or North Bergen, was born in the United States and is the son of Palestinian immigrants. Almonte, 24, of Elmwood Park, is a naturalized citizen who was born in the Dominican Republic. Both are Muslim.

Philip Seymour Hoffman withdrew a total of $1,200 from an ATM at a supermarket near his New York City apartment the night before he was found lifeless in his bathroom with a syringe still in his left arm, sources told NBC News.

The men, both with short dark hair and long beards, were lead into the courtroom in handcuffs and prison scrubs. Alessa smiled at family members, including his parents, who were seated in the courtroom. They took turns entering their pleas alongside their lawyers, and each man answered a series of questions from U.S. District Judge Dickinson Debevoise in a clear, loud voice.

The charge each pleaded to could carry up to life in prison, but they face 15 to 30 years under the terms of the plea agreement. Sentencing is up to the discretion of the judge, and will likely take place sometime this summer.

Alessa's father and mother exited the courtroom without commenting. A man, who declined to give his name but escorted the parents after giving Alessa's father a long hug, said; "they don't wish to comment at this time, it's a sad day for them."

School officials, law enforcement authorities and court records have painted a picture of two as trouble-prone young men.

Officials at several northern New Jersey schools described Alessa as a disruptive and violent youth who ultimately had to be taught separately from other students and with a security guard present. Almonte's criminal record includes arrests for aggravated assault and weapons possession.

While court documents paint a picture of two men deeply committed to terrorism, their training was apparently scattershot. They lifted weights, hiked in the snow at a local park, bought military-style pants and water bottles, played paintball and violent video games and watched terrorist videos online.

The two came to the attention of authorities long before their June arrests. An undercover officer from the NYPD who had posed as a devout Muslim and circulated among other men with radical leanings in the New York City area — met the suspects in 2009 and won their trust, authorities said. He got close enough to them to secretly record their radical rants about fighting a holy war here and abroad.

Alessa's lawyer, Stanley Cohen, said his client was more a misguided youth who talked tough, than a hardened militant.

"These are very young men; this activity began when my client was 16 years-old," Cohen said, adding that a conspiracy charge carried "few evidentiary requirements."

Almonte's lawyer, James Patton, said it was a difficult day for his client.

U.S. Attorney Fishman said the case underscored the importance of successful law enforcement cooperation and continued vigilance.

"Alessa's and Almonte's own words confirm they took steps down a deadly path," Fishman said in a statement. "The defendants planned and trained for a mission that began in their New Jersey neighborhoods and would end with the murder of innocent civilians."

Copyright 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.