In public, Hasan Edmonds wore the uniform of the Illinois National Guard.

But in private, the 22-year-old allegedly answered to a different master.

“I wish only to serve in the army of Allah, alongside my true brothers,” the National Guard specialist from Aurora wrote in an email just two months ago, according to a federal complaint unsealed on Thursday.

That meant attempting to travel to Syria, to fight alongside Islamic State terrorists, the feds say. And it meant plotting with his cousin to kill 120 of his fellow U.S. soldiers right here, in Illinois.

Arrested Wednesday evening at Midway Airport as he attempted to fly to Cairo, Egypt, Hasan Edmonds served with the 634th Brigade Support Battalion in Joliet. After he left the country, his cousin, 29-year-old Jonas Edmonds, planned to disguise himself in Hasan’s uniform and attack the base where Hasan had been training, the feds say.

Jonas Edmonds was arrested without incident at his home in Aurora around the same time that his cousin was nabbed, authorities said. Hasan Edmonds had allegedly identified officers for him to target, telling him to “kill the head.”

Hasan Edmonds | (facebook)

Hasan Edmonds | Photo from Facebook

Both men were denied bail during a brief court appearance Thursday. Jonas Edmonds appeared confused, scanning the courtroom before sitting facing his attorney at a side table. He repeatedly swiveled in his chair, yawned loudly and tugged at his long beard with both hands for several seconds. After the hearing, he shook the shackles on his feet several times, making a loud noise.

Hasan Edmonds, who has a shaved head and wore glasses, silently sat facing his cousin, but appeared less agitated.

The military training he received, along with his access to military facilities, appears to elevate the seriousness of his alleged threat well above those of several recently charged Chicago-area teenage plotters, who have been plausibly portrayed as, at worst, determined wannabes.

Facebook messages Hasan Edmonds sent to an undercover FBI agent show that he was willing to martyr himself for the ISIL cause and expected his cousin to do the same, according to the criminal complaint.

The cousins’ grandmother, Lubertha Bates, said the FBI, Homeland Security and police searched her home Wednesday night and left with computers. Both men’s homes were also searched by the feds Wednesday evening.

And Hasan Edmonds’ sister, Manchinique Bates, denied the men wanted to join ISIL. She said she grew up with them, and both talked frequently about wanting to travel.

“They aren’t terrorists,” Bates said. “They don’t come off as terrorists. Just because they choose to worship as Muslims does not make them terrorists.”

Another cousin, Vicki Williams, 52, of Hammond, Louisiana, said Hasan was following in the footsteps of his father, convicted sex offender Lieukennye Edmonds, when he became an observant Muslim.

But the feds presented what they say is damning evidence against both Hasan and Jonas Edmonds: Facebook chats and secret meetings with the undercover agent, who tracked every step of the plot in an elaborate sting. In one online chat with the undercover agent, Hasan Edmonds allegedly wrote “I am already in the american kafir army (back when I was still in this dunyah and not muslim) and now I wish only to serve in the army of Allah alongside my true brothers.” Kafir means infidel and dunyah means “of this world,” according to the feds.

Jonas Edmonds | (West Aurora High School yearbook photo)

Jonas Edmonds | West Aurora High School yearbook photo

“I joined the united states army national guard about 3 years ago. I still currently have 3 years left that I have no intention what so ever of fulfilling.”

In another Facebook chat he wrote, “I am no expert with our weapons but I can get the job done.”

“I pray to just one time step foot in the land ruled by the Law of the Quran but I am content to fight and die here in the cause of Allah whenever the target is set and the order is given. InshaAllah my brothers will march with me as well.”

The feds say Hasan Edmonds wrote that his cousin, who has served time in a Georgia prison, would “put the fear of Allah in their hearts and minds right here in the homeland.”

“I can own handguns shotguns and rifles but no automatic weapons or heavy machine guns,” he allegedly wrote in another online chat. “We have plenty people here who have them and hide them so we will do the same.”

“It would be hard to pull off a lager scale attack on the government but police stations and courts are pretty easy and it’s been done before by kufar sometimes just one person.”

He allegedly hoped that the attack in Illinois would have a similar effect to the attack on the Charlie Hebdo offices in Paris earlier this year. “Honestly we would love to do something like the brother in Paris did,” he wrote in one message, the feds say.

And on Tuesday, both cousins met with the undercover agent and traveled to Hasan Edmonds’ National Guard base. “When they arrived, the three discussed, among other things, where soldiers at the installation trained,” the complaint states.

“Also during this meeting, Hasan Edmonds described the inside of the installation and which rooms they should avoid during the attack. Hasan Edmonds also entered the installation and retrieved a military training schedule, which he then gave to Jonas Edmonds.”

The feds say they became suspicious of Hasan Edmonds late last year, when the FBI learned that he and Jonas Edmonds had devised a plan for Hasan Edmonds to travel overseas and use his military training to fight for the Islamic State.

Hasan Edmonds, who attended Aurora West High School, had planned to arrive in Cairo Thursday, with layovers in Detroit and Amsterdam, the feds say.

Jonas Edmonds was previously convicted of conspiracy to commit armed robbery and was sentenced to state prison, Cobb County, Georgia court records show. He was behind bars between 2005 and 2010, when he was paroled, records show. He also attended West Aurora in 2004 but he left school that year, which was his senior year, said Tony Martinez of the West Aurora School District.

Lt. Col. Brad Leighton, the public affairs director of the Illinois National Guard, said that Hasan Edmonds reported to the guard’s Joliet base one weekend a month and that he did two weeks of active-duty training, typically in the summer.

He enlisted in August 2011 and had never deployed, but worked as a supply specialist that was part of a logistics unit that provides supplies and other services to the 33rd Infantry Brigade Combat Team, Leighton said. He added that Edmonds had last reported for duty earlier this month, but said that the guard’s focus was on “ensuring the safety of our soldiers, airmen and their families.”

FILE - This file image posted on a militant website on Tuesday, Jan. 7, 2014, which is consistent with AP reporting, shows a convoy of vehicles and fighters from the al-Qaida-linked Islamic State of Iraq and the Levant (ISIL) fighters in Iraq's Anbar Province. The Islamic State was originally al-Qaida's branch in Iraq, but it used Syria's civil war to vault into something more powerful. It defied orders from al-Qaida's central command and expanded its operations into Syria, ostensibly to fight to topple Assad. But it has turned mainly to conquering territory for itself, often battling other rebels who stand in the way. (AP Photo/militant website, File)

This file image posted on a militant website shows a convoy of vehicles and fighters from ISIL in Iraq’s Anbar Province. | Distributed by the Associated Press

He also said the guard won’t let the arrest “detract us from fulfilling our missions.”

Other federal authorities also stressed that they were careful at every step of the investigation to protect those who served alongside Hasan Edmonds.

But Assistant Attorney General John Carlin said, “Disturbingly, one of the defendants currently wears the same uniform of those they allegedly planned to attack.  I want to thank the many agents, analysts, and prosecutors who are responsible for disrupting the threat posed by these defendants.”

Gov. Bruce Rauner, after being briefed on the ongoing investigation, issued a statement thanking the FBI and the guard for their work in the case.

“On behalf of all citizens of Illinois, I thank all the members of our National Guard as well as the FBI for protecting our state and defending our country,” Rauner said in the statement.

In this courtroom sketch, Jonas M. Edmonds, left, and Hasan R. Edmonds, right, stand in front of an FBI agent as they appear at a hearing at federal court in Chicago, Thursday, March 26, 2015, following their arrests Wednesday on charges of conspiring with the Islamic State group. | (AP Photo/Tom Gianni)

In this courtroom sketch, Jonas M. Edmonds, left, and Hasan R. Edmonds, right, stand in front of an FBI agent as they appear at a hearing at federal court in Chicago, Thursday, March 26, 2015, following their arrests Wednesday on charges of conspiring with the Islamic State group. | (AP Photo/Tom Gianni)

EDMONDS Complaint Affidavit