Two California men described as "homegrown violent extremists" appeared in federal court Friday after they were arrested late Thursday while in the process of heading overseas to join ISIS, authorities said.

Muhanad Badawi and Nader Elhuzayel, both 24 and of Anaheim, were nabbed by the Orange County Joint Terrorism Task Force, Elhuzayel at Los Angeles International Airport and Badawi in Orange County. The task force includes officials from the FBI, Anaheim Police Department and the Orange County Sheriff’s Department. A senior law enforcement official told Fox News the arrests were “related” to national security, but that the public was never in danger.

On Friday, both men appeared in shackles in a packed federal courtroom in Santa Ana. Elhuzayel, who looked down during much of the proceedings, was arrested late Thursday at Los Angeles International Airport and will return for a detention hearing Wednesday. His family and lawyer declined to comment after the hearing.

Badawi, who appeared to listen intently to the judge, was held without bail, though his attorney said she may seek his release with restrictions to ensure he attends court. He was taken into custody late Thursday near his home in Anaheim, where both men live, authorities said.

Prosecutors charged the men with conspiring to provide material support to the Islamic State group.

Both men were described as "homegrown violent extremists" who were heading overseas, according to two sources who spoke to the Los Angeles Times. The suspects are due in federal court in Santa Ana Friday.

According to the complaint, Badawi and Elhuzayel used social media to discuss terrorist attacks and expressed a desire to die as martyrs.

According to the complaint, Elhuzayel asked Badawi "can you imagine when Al Qaeda joins with Islamic State?" to which Badawi allegedly responded: "we will be huge."

The pair "discussed how it would be a blessing to fight for the cause of Allah, and to die in the battlefield," referring to ISIS as "we," the complaint says. 

The Orange County Register, citing Elhuzayel's parents, said he was nabbed after they dropped him off to catch a flight to Israel to visit aunts and cousins in Palestine

“I think they’re looking for a victim and Nader is an easy (target),” Salem Elhuzayel told the newspaper. “He’s an innocent human being to visit family to stay one or two months then come back.”

But Elhuzayel's parents acknowledged he had become a more devout Muslim over the past six months, growing his hair out and worshipping at the nearby Islamic Center of Anaheim.

Authorities did not disclose the location of Badawi's arrest.

If convicted of the charges, the pair could face up to 15 years in prison.

Fox News' Matthew Dean contributed to this report