Federal authorities have arrested a Syrian refugee who was plotting to attack a Pittsburgh church, the Department of Justice announced Wednesday.

Mustafa Mousab Alowemer, 21, was charged with one count of attempting to provide material support and resources to a terror group and two counts of distributing information relating to an explosive, destructive device, or weapon of mass destruction, officials said.

Alowemer, who was admitted to the US as a refugee on Aug. 1, 2016, gave bomb-making instructions to an undercover FBI agent as part of a plot to blow up the primarily Nigerian-attended Legacy International Worship Center Christian church on Pittsburgh’s north side.

He wanted to inspire further attacks and “take revenge for our [ISIS] brothers in Nigeria,” he told FBI investigators, according to the DOJ.

“Targeting places of worship is beyond the pale, no matter what the motivation,” said Assistant Attorney General for National Security John Demers.

In online chats with the undercover — who Alowemer referred to as a “brother” from the “Caliphate soldiers — Alowemer offered to find other terror targets in Pittsburgh, requested a gun with a silencer and recorded a video of himself pledging allegiance to ISIS leader, Abu Bakr Al-Baghdadi, the feds said.

By June, he had purchased bomb-making supplies, and during one of four in-person meetings with an FBI undercover, he provided satellite maps of the church with hand-written notes marking escape routes — as well as a handwritten 10-point plan outlining how he’d personally deliver a backpack full of explosives to the house of worship.

Alowemer, who also fantasized about hunting US soldiers in the Pittsburgh area, often referred to bombs as “meals,” “cooking” and “spice,” according to a criminal complaint.

“There are a couple [students] who work with the military if they are going to collage [sic] with me we might start hunting brother and feed them :),” he told the undercover, later adding: “Yes, they can taste it and I’m positive they will love it.”