NEWARK, N.J. – Two New Jersey men accused of trying to join a terrorist group in Somalia intended to commit acts of violence even though their plans appeared haphazard, a federal prosecutor said Monday.

“Sophistication is not a measure of danger,” U.S. Attorney Paul Fishman said. “Their intentions were described pretty clearly. They were watching certain videos and interested in what certain people were saying and advocating.”

Mohamed Mahmood Alessa, 20, and Carlos Eduardo Almonte, 24, were arrested Saturday night at New York’s Kennedy Airport as they prepared to fly to Egypt and then to Somalia, authorities said.

They are charged with conspiring to kill, maim and kidnap persons outside the United States by joining al-Shabab, a group designated by the United States in 2008 as a terrorist organization.

Alessa and Almonte made their first court appearance Monday in Newark before U.S. Magistrate Judge Madeline Cox Arleo. They spoke only to affirm that they understood the charges against them.

Both men will be held without bail pending a detention hearing Thursday. If convicted, they could face life in prison.

Investigators say the two Muslim men were headed to Somalia to seek terror training from al-Qaida-affiliated jihadists and to unleash attacks against fellow Americans.

But their preparations apparently were far from sophisticated. They lifted weights, bought military-style pants, tried paintball, played violent video games and watched terrorist videos online, authorities said. The only weapons they possessed were two folding knives.

Law enforcement became aware of the men in the fall of 2006, when the FBI received an anonymous tip through its website, and some unidentified family members cooperated with investigators, according to a criminal complaint.

In March 2007, the FBI conducted a consensual search of Almonte’s computer, revealing documents advocating jihad against the perceived enemies of Islam, court papers show.

An undercover officer met the men last year and began recording conversations in which the two spoke about jihad against Americans, investigators said in court papers.

“I leave this time. God willing, I never come back,” authorities say Alessa told the officer last year.

“Only way I would come back here is if I was in the land of jihad and the leader ordered me to come back here and do something here. Ah, I love that.”

Younus Mohammad, a 31-year-old from Brooklyn, said he knew of Alessa and Almonte from northern New Jersey’s Arab-American community and considered them fervent but relatively harmless.

“These were just young, zealous kids who had zeal because they perceived their religion is under attack in America and they spoke out,” he said. “I think they were just wild-eyed, with aims that would have been impossible to carry out.”