Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An Ohio man who allegedly wanted to set up an ISIS cell in the U.S. was arrested Wednesday and accused of planning to attack the U.S. Capitol. But U.S. officials told NBC News the man was dealing with a government informer working undercover the entire time and was never in a position to carry out his plan.

Christopher Lee Cornell, 20, of Green Township, near Cincinnati, was arrested after he bought two M-15 semi-automatic rifles and about 600 rounds of ammunition as the undercover operative watched, according to an FBI affidavit.

Officials said Cornell never bought any components for pipe bombs. "There was never a danger to the public," an official told NBC News.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

A preliminary hearing was scheduled for Jan. 22 in U.S. District Court in Cincinnati on charges of the attempted killing of a U.S. government officer and possession of a firearm in furtherance of an attempted crime of violence.

Cornell's father, John Cornell, said the family was blindsided by the arrest.

"He never showed any signs of violence or anything," John Cornell said of his son.

Christopher Lee Cornell, 20, of Green Township, near Cincinnati, was arrested after he bought two M-15 semi-automatic rifles and about 600 rounds of ammunition and accused of planning to attack the U.S. Capitol, according to the FBI. Butler County Sheriff

The FBI said the informer alerted authorities in August that Cornell — under an alias, Raheel Mahrus Ubaydah — was posting comments on Twitter in support of ISIS. Shortly after those posts began appearing, the FBI sent the operative to meet with him undercover.

During a meeting with the operative, court documents say, Cornell said he wanted "to go forward with violent jihad" and that Anwar al-Awlaki — the U.S.-born Muslim cleric who was killed by a U.S. drone in September 2011 and was the first U.S. citizen publicly known to have been added to the U.S. kill-or-capture list — and others had encouraged that kind of action.

According to the FBI, Cornell made it clear early on that he hoped to create an ISIS cell in the U.S., telling the undercover agent in a text message: "I believe we should meet up and make our own group in alliance with the Islamic State here and plan operations ourselves."

Later, in a meeting in November, the FBI said, Cornell said he wanted to "build, plant, and detonate pipe bombs at and near the U.S. Capitol," then "shoot and kill employees and officials."

In 2011, Rezwan Ferdaus, of Ashland, Massachusetts, was charged with plotting to attack the Capitol and the Pentagon with a remote-controlled aircraft filled with plastic explosives. He was sentenced to 17 years in prison. He, too, was dealing with undercover agents the whole time.