Newark, New Jersey -- Two New Jersey men arrested Saturday for allegedly planning to "wage violent jihad" made their first court appearance Monday.
Mohamed Mahmood Alessa, 20, of North Bergen, New Jersey, and Carlos Eduardo Almonte, 24, of Elmwood Park, New Jersey, entered U.S. District Court in Newark wearing chains around their waists and wrists.
They were read a charge -- one count of conspiracy to kill, maim and murder persons outside of the United States -- which carries a maximum sentence of life in prison.
Alessa had bruises on his forehead and cheek. His father, Mahmood Alessa, said they appeared to be fresh. Both defendants said "yes" when asked if they wanted court-appointed legal representation.
Magistrate Judge Madeline Cox Arleo set a bail hearing for Thursday and a pretrial hearing for June 21.
After the five-minute hearing, Alessa raised his index finger and flashed a broad smile to his father sitting in the rear of the courtroom, who appeared distressed.
The men, who were taken into custody at John F. Kennedy International Airport, intended to take separate flights to Egypt on their way to Somalia "to join designated foreign terrorist organization Al-Shabaab and wage violent jihad," according to federal prosecutors.
Alessa and Almonte also are charged with conspiring to kidnap, maim and kill people outside the United States, according to court documents.
The FBI received a tip regarding their activities in October 2006, according to the U.S. attorney's office in New Jersey. The tip, from someone who knew the men, said, "Every time they access the Internet all they look for is all those terrorist videos. ... They keep saying that Americans are their enemies, that everybody other than Islamic followers are their enemies ... and they all must be killed," court documents said.
As part of the investigation, an undercover officer with the New York Police Department's intelligence unit recorded meetings and conversations with the two men, prosecutors said.
During those meetings, they discussed a plan to save thousands of dollars and physically condition themselves through paintball games and other training, acquire military gear and apparel for use overseas, and buy plane tickets to Egypt with the intent to travel to Somalia, prosecutors said.
"The defendants also discussed their obligation to wage violent jihad and at times expressed a willingness to commit acts of violence in the United States," prosecutors said.
In the presence of the undercover officer, Alessa discussed buying a plane ticket to Egypt with his father, ostensibly for him to attend school there, according to the criminal complaint.
The two were arrested at the airport after they had gone through security but prior to boarding -- an intentional move, a law enforcement official told CNN, as authorities wanted to establish they were intending to go overseas.
The FBI said both men resisted arrest, according to Paul Fishman, U.S. attorney general for the New Jersey district.
FBI agents also raided two homes in New Jersey, the Newark Star-Ledger newspaper reported, and the arrests were part of an investigation known as Operation Arabian Knight.
CNN's Allan Chernoff contributed to this story.