A Utah man was sentenced to five years in prison for firing a gun at a Salt Lake City synagogue in 2012.

Macon Openshaw, 22, of Salt Lake City, pleaded guilty on April 16 in U.S. District Court for the District of Utah to firing three rounds from a handgun at Congregation Kol Ami, according to a statement from the U.S. Department of Justice. The shots broke windows and damaged the window casings.

Openshaw admitted to shooting at the synagogue because of its Jewish character.

“Religiously motivated violence cannot be tolerated by civil society,” Acting Assistant U.S. Attorney General Jocelyn Samuels said in a statement.

Openshaw also was ordered to pay $1,969 to the synagogue to pay for the damage caused by his attack.