A Syrian refugee who came to the United States three years ago has been charged in an ISIS-inspired plot to bomb a Christian church in Pittsburgh, the Justice Department said Wednesday.

Mustafa Mousab Alowemer, 21, recorded a video of himself pledging an oath of allegiance to the leader of the Islamic State group and bought bomb-making materials for a FBI undercover employee and a FBI confidential source to use in an attack, according to the U.S. Attorney's Office.

He was arrested Wednesday and charged with one count of attempting to provide material support to ISIS and two counts of distributing information about making bombs in relation to the planned assault.

"Targeting places of worship is beyond the pale, no matter what the motivation," Assistant Attorney General John Demers said. "The defendant is alleged to have plotted just such an attack of a church in Pittsburgh in the name of ISIS."

Court documents say Alowemer provided Google satellite maps to the FBI undercover employee and the confidential source describing routes of arrival and escape to the church. The FBI identified the site of the attack as the Legacy International Worship Center, court documents say.

Alowemer never obtained any explosives. Prosecutors say he thought that the undercover employee and the confidential source, whom he believed were fellow ISIS supporters, would be involved in the construction of the bombs with him.

Alowemer sent the undercover FBI employee two documents related to explosives — a "Beginners Course for Young Mujahedeen" and "The Extraction of Potassium Nitrate from Goat Manure and Other Methods."

Alowemer's discussions with the FBI source indicated that he wanted more time to plan and coordinate the attack before carrying it out in July. He was plotting to set off the bomb in the middle of the night, around 3 or 4 a.m., the court documents say.

Federal prosecutors say Alowemer was admitted to the U.S. as a refugee on Aug. 1, 2016. He went on to graduate from high school but does not hold a U.S. passport and is not a legal permanent resident of the U.S.

He first came to the attention of authorities because of a jihadist-oriented message he posted on an internet bulletin board and because he was communicating with an ISIS-supporter in the U.S. who was already under investigation, the court documents say. Authorities say there was never any danger to the public because Alowemer was under FBI surveillance for months.