Abdella Ahmad Tounisi of Aurora, Illinois, was taken into custody late on Friday as he prepared to board a plane at Chicago's O'Hare International Airport bound for Turkey, the FBI said in a statement.
It added that Tounisi was a friend of Adel Daoud, an American accused of trying to stage a bombing outside a downtown Chicago bar last year. The agency said Tounisi had not been involved in that plot.
Tounisiappeared before a U.S. magistrate on Saturday on one count of attempting to provide material support to a foreign terrorist organization. He was ordered held until his next court appearance on Tuesday, the FBI said.
A criminal complaint accused Tounisi of making online contact in March with a person he thought was a recruiter for Jabhat al-Nusrah, the militant Islamist Syrian group that the U.S. government calls a foreign terrorist organization operating as a wing of al Qaeda in Iraq.
The supposed recruiter was an FBI employee working undercover, the agency said.
Tounisi said in emails to the FBI employee that he planned to get to Syria via Turkey and was willing to die in the Syrian struggle, the complaint said.
Syria is in the grips of a civil war that began in 2011 as a revolt against President Bashar al-Assad and has killed more than 70,000 people.
On April 10, Tounisi bought an airline ticket for a flight from Chicago to Istanbul. On Thursday, the undercover FBI employee gave him a bus ticket for travel from Istanbul to Gaziantep, Turkey, near the border with Syria, the complaint said.
Tounisi's attorney, Michael Madden, of the federal public defender program could not be reached for comment.
Tounisi faces a maximum of 15 years in prison if convicted.
The 2012 arrest of Daoud, 19, also involved his alleged communication with an undercover member of the FBI. The fake bomb that Daoud tried to detonate outside a Chicago bar was provided to him by an undercover FBI agent, authorities said.
Daoud was indicted on two counts of attempting to use a weapon of mass destruction and maliciously attempting to use an explosive to destroy a building. He pleaded not guilty in October in federal court.
(Reporting by Alex Dobuzinskis in Los Angeles; Editing by Peter Cooney)