Handcuffs (Tribune photo illustration)

A Hillside teenager has been charged with trying to detonate a car bomb outside a bar in downtown Chicago, following months of surveillance in which he boasted to undercover federal agents of ignoring reprimands from a mosque leader against plans for terrorism, the U.S. attorney's office announced.

Adel Daoud, 18,  parked a green Jeep Cherokee in front of the bar Friday night, then tried to detonate a device he believed to be a bomb as he walked away into an alley, court documents allege.

But the bomb, which was inert and had been planted by FBI agents , didn't explode and Daoud was arrested on the spot, federal authorities said.

Daoud was charged with attempting to use a weapon of mass destruction and attempting to damage and destroy a building by means of an explosive. A preliminary hearing is scheduled for Monday afternoon at the U.S. Dirksen Courthouse.

Authorities did not name the bar that Daoud allegedly targeted.

Daoud acted alone, although he talked of trying to "brainwash" others and at one point allegedly enlisted a partner, who later changed his mind, according to an FBI affidavit.

In one string of emails to an undercover operative filled with American teen slang, Daoud allegedly complained: "man is hard to tell people to be terrorists."

"Even my sheikh … was talking to me about NOT talking about jihad," Daoud allegedly wrote in another message.

"lol man I will be the opposite," Daoud allegedly wrote.

Daoud, a U.S. citizen, had allegedly been sharing information online about killing Americans in a terrorist attack since October 2011.

He was motivated to target U.S. citizens because of what he perceived as American abuses overseas and because he believes the U.S. is at war "with Islam and Muslims," the affidavit says.

In May, two undercover FBI operatives started exchanging messages with him.

One of the operatives told Daoud he had a cousin who wanted to commit terrorism. Daoud allegedly replied that he "would love to meet him."

The "cousin" was actually an FBI agent. He and Daoud met several times in Villa Park. During their first meeting, in July, the agent told Daoud "that he and his brothers were interested in attacking a major city, including perhaps Chicago," the affidavit said.

At their next meeting, Daoud allegedly gave the agent a handwritten list of 29 potential targets, including military recruiting offices, bars, malls and tourist attractions in the Chicago area.

Daoud allegedly told the agent that he wanted it to be clear that the attack was an act of terrorism.

"It'll be like frantic," Daoud allegedly told the agent.

Daoud also allegedly said he wanted the attack to be as deadly as possible.

"If it's only like five, 10 people, I'm not gonna feel that good," Daoud allegedly told the agent. "I wanted something that's … massive; I want something that's gonna make it in the news like tonight."

Daoud allegedly discussed his plans with several people, and successfully enlisted one person who suggested they target a popular nightclub.