Three members of a Kansas militia were convicted by a federal jury on Wednesday of plotting to bomb a Somali apartment complex and mosque, in what prosecutors called an act of domestic terrorism.

The men — Curtis Allen, Gavin Wright and Patrick Eugene Stein — were each convicted on one count of conspiracy to use a weapon of mass destruction and one count of conspiracy against civil rights. Wright was also found guilty of lying to the FBI.

"The defendants in this case acted with clear premeditation in an attempt to kill people on the basis of their religion and national origin," said US Attorney General Jeff Session. "That's not just illegal it's immoral and unacceptable, and we're not going to stand for it."

Read more: Somalia's parliament and presidential palace rocked by nearby car bomb blast

The three men were members of a right-wing militia called the Kansas Security Force and formed a splinter group, the Crusaders, prosecutors said. One member of the militia tipped off the plot to the FBI and agreed to wear a wire after he was approached to participate in the plot.

"That confidential source is also to be commended for doing the right thing and the courage he demonstrated," said US Attorney Stephen McAllister.

Read more: Germany sees almost 1,000 anti-Muslim crimes in 2017

Prosecutors said the three men had stockpiled weapons and explosives in preparation for an attack on a Somali refugee community in the western Kansas town of Garden City. They said the plotters intended to park vehicles at four corners of the apartment complex and a mosque next to it, then explode bombs to cause maximum death and destruction.

"Evidence during trial established that the defendants held numerous meetings to plan the attack and took significant steps — including making and testing explosives toward implementing their plan," the Justice Department said.

The defense argued the FBI used entrapment and the informant had provided maps and suggested the bombing. It also argued the defendants were their exercising freedom of speech and never intended to act on the attack.

Stein was arrested in 2016 when he delivered fertilizer to undercover FBI agents to make explosives. The three men were indicted in October 2016.

They face up to life imprisonment when they are sentenced in June.

cw/rc (AP, dpa, Reuters)