Two men who came to the U.S. from Somali as refugees were arrested after attempting to fly from Arizona to Egypt, allegedly with the intention of joining the Islamic State.

In a Monday press release, the Justice Department announced the arrests of Ahmed Mahad Mohamed and Abdi Yemani Hussein. Both defendants came to the U.S. as refugees from Somalia, although Mohamed had obtained permanent resident status. They were arrested while attempting to board a flight at Tucson International Airport on Friday.

According to the affidavit in the case, the two men were being surveilled by an undercover FBI agent who was pretending to be a supporter of ISIS. Mohamed allegedly started talking to the undercover agent on an unnamed social media platform last August, continuing with another undercover agent in December.

The duo allegedly wanted to travel to the Middle East to fight for the terrorist group or attack somewhere in the U.S.

The FBI said that in August, Mohamed wrote to the undercover employee that he wanted to achieve martyrdom.

“I love jihad so much,” the court document details. Mohamed allegedly told the second undercover employee in December, “If I go to Syria I want to be the beheading person, … I want to kill them so many I am thirsty their blood.”

On June 24, the two men met with an undercover employee in Tucson, where Hussein allegedly said that he will “kill so many people” and that he wants “to be on the front line.”

Then, after purchasing round trip tickets, the two were arrested by FBI special agents Friday while proceeding through the security checkpoint at Tucson International Airport. They were charged with conspiring to provide material support to ISIS.