WASHINGTON - Authorities arrested both an Illinois Army National Guardsman who tried to travel to Libya and fight with the Islamic State and a cousin who was plotting to attack a U.S. military installation and kill scores, federal prosecutors announced Thursday.

Hasan Rasheed Edmonds, 22, and his cousin Jonas Marcel Edmonds, 29, both of Aurora, Ill., were charged with conspiring to provide material support to a terrorist organization.

FBI agents intercepted Hasan Edmonds at Chicago Midway International Airport on Wednesday evening before he was able to board a flight to Detroit and ultimately make his way to Cairo via Amsterdam.

His cousin was taken into custody without incident at his home after taking Hasan Edmonds to the airport. The two men appeared Thursday in federal court, where a judge ordered them held. One of their lawyers declined to comment, while the other could not be reached.

Prosecutors said Hasan Edmonds, a specialist in the Illinois Army National Guard, came to the attention of the FBI late last year when investigators learned that he intended to use his military training on behalf of the Islamic State.

Once Edmonds was out of the country, the FBI said, his cousin, a convicted felon, planned to attack a U.S. military facility in northern Illinois.

It is unclear how Hasan Edmonds first came to the attention of the FBI, but last year an undercover agent sent him a message on Facebook, according to a criminal complaint. In response, Edmonds said he was trying to get all his "affairs in order and get my funds up for the plunge."

"I want to make sure my affairs here are set before leaving to give my all for this deen" or faith, he said.

In January, Edmonds received another message from the undercover FBI agent, asking if he was going to Turkey or Egypt to study.

"I wish to go to Dawlah," Edmonds said. Dawlah is used frequently to refer to the Islamic State. He later told the undercover agent he was required to support the Islamic State.

"The State has been established and it is our duty to heed the call," he said. "Inshallah we will complete our task or be granted shahada," or martyrdom.

Edmonds enlisted in the National Guard in August 2011. He was a supply specialist and an enlisted specialist in rank, said Lt. Col. Brad Leighton, public affairs director for the Illinois National Guard.

Explaining his military training, Edmonds had said he was "no expert with our weapons but I can get the job done."

Once Edmonds arrived in Cairo, another individual was supposed to assist him in traveling to Derna, Libya, a city controlled by the Islamic State, according to the criminal complaint.