A suspect dubbed the "hipster terrorist" -- for his stylish beard and captivating social media photos showing him with designer sunglasses and an iced latte -- pleaded guilty Wednesday to aiding a terrorist organization.

Meanwhile, a second suspect, in an unrelated case, was ordered jailed until trial after being accused of spreading propaganda for the Islamic State group.

The first suspect, Aws Mohammed Younis al-Jayab, 25, entered his plea, which includes lying to immigration officials, ina federal courtroom in Chicago, the Chicago Tribune reported.

As part of a plea agreement with prosecutors, al-Jayab admitted to flying from Chicago to Turkey in November 2013 and entering Syria. He then joined with Al-Islam, a precursor to the Islamic State group.

“I wanted to do the right thing … to defend the Syrian people,” al-Jayab told U.S. District Judge Sarah Ellis Wednesday in broken English.

Al-Jayab's lawyers previously argued he was entitled to "combatant immunity" because he linked up not with terrorists, but with Syrian rebels the U.S. has backed in hopes of ousting Syrian leader Bashar al-Assad.

He faces up to 15 years in prison, per his plea agreement.

Al-Jayab, a Palestinian-born Iraqi, returned to the U.S. in 2014 and settled in Sacramento, Calif., where he registered for computer science classes at a community college. He told immigration officials he had been overseas visiting relatives.

He spent much of his childhood in Iraq before coming to the U.S. as a refugee in 2012.

While living in Wisconsin and Arizona, he communicated on social media about his intention of traveling to Syria to fight for terrorist groups.

“America will not isolate me from my Islamic duty,” he wrote to a colleague in Syria, according to the charges. “Only death will do us part. My only wish is to see you and start the action.”

In another terror case in Chicago, a federal judge ordered a computer-science specialist accused of being an online propagandist for ISIS jailed until trial.

The judge cited photos arresting agents found on his phone this month showing bomb-making components. Some of his alleged propaganda included a video showing a Christmas gift containing a ticking time bomb.

Al Safoo, 34, a naturalized citizen from Iraq, faces conspiracy to provide material support to terrorists, which carries up to 20 years in prison.

A federal complaint also describes his annoyance at being the butt of jokes. He allegedly sent a text message meant to warn about beheading President Donald Trump. An app used to translate Arabic instead warned about "kissing and hugging" Trump.

The Associated Press contributed to this report.