Two Tucson men, both refugees from Somalia, have been arrested on suspicion of trying to join the Islamic State and fight for the terror group or launch an attack on U.S. soil, federal officials said Monday.

Ahmed Mahad Mohamed, 21, and Abdi Yemani Hussein, 20, were arrested Friday at the Tucson International Airport, according to a news release from the U.S. Attorney’s Office in Arizona. The two are facing charges of conspiracy to provide material support to a designated foreign terrorist organization.

Mohamed, a permanent resident of the U.S., and Hussein, a refugee, had been communicating with an undercover FBI agent who they believed was a supporter of IS ideology, according to a federal criminal complaint filed Friday.

Mohamed and Hussein revealed during the communications that they wanted to travel overseas to fight on behalf of IS or conduct an attack within the U.S. if they were unable to travel, the criminal complaint said.

The men purchased tickets to travel from Tucson to Egypt, with the intent to travel on to the Sinai Peninsula and join IS, according to the news release.

FBI agents arrested the men after they checked in for their flight and passed through airport security, officials said.