(CNN) —  

A federal jury found three men guilty of conspiring to bomb a Kansas apartment complex to target Somali refugees.

The three were convicted on one count of conspiracy to use a weapon of mass destruction and one count of conspiracy to violate the housing rights of their intended victims.

Patrick Eugene Stein, 49, of Kansas, Curtis Allen, 50, of Kansas, and Gavin Wright, 49, of Oklahoma, were convicted on one count of conspiracy to use a weapon of mass destruction and one count of conspiracy to violate the housing rights of their intended victims. In addition, Wright was also convicted of lying to the FBI.

The three men had “expressed hatred for the Somali immigrants, and Muslims in general and described in the most extreme and violent terms what they planned to do to them,” said US Attorney Stephen McAllister in a news briefing Wednesday.

During the trial, prosecutors said the men referred to Muslims as cockroaches and began plotting an attack after the 2016 Pulse nightclub shooting, reported CNN affiliate KCWH.

They conspired to build and detonate a weapon of mass destruction, and chose the apartment complex in Garden City, Kansas, partly because it contained a mosque, McAllister said.

About 120 Somali immigrants live there, as many have been drawn to the city because of jobs in the meatpacking industry, reported CNN affiliate KSNW.

The three defendants held several meetings to discuss their plan, and the FBI was tipped off by a confidential source who recorded some of their conversations. They were members of a militia group, calling itself The Crusaders and sought to “wake people up,” the DOJ said at the time they were charged in 2016.

“The defendants discussed among other plans, obtaining vehicles, filling them with explosives and parking them at the four corners of the apartment complex to create an explosion that would bring down and level the entire complex,” McAllister said.

They downloaded instructions for making homemade explosives and also tested them, he said.

But defense attorneys argued that the men’s discussions hadn’t been that serious and questioned the credibility of the paid informant used by the FBI. The lawyers also said the defendants had a right to free speech, reported KSNW.

During the eight-month investigation, the FBI introduced an undercover agent posing as a black market arms dealer. That agent received 300 pounds of fertilizer for use in constructing a bomb from Stein and was also taken to see the building they were targeting, according to prosecutors.

“The Department of Justice is resolute every day in fighting terrorist threats to the United States, both foreign and domestic,” said Attorney General Jeff Sessions in a statement. “The defendants in this case acted with clear premeditation in an attempt to kill people on the basis of their religion and national origin. That’s not just illegal – it’s immoral and unacceptable, and we’re not going to stand for it.”

Madihha Ahussain, special counsel for anti-Muslim bigotry for Muslim Advocates, said they were glad to learn of the convictions.

“Nevertheless, we must not ignore the dangerous plans these men intended to carry out or the greater context in which this occurred,” she said in a statement.

“Anti-Muslim rhetoric has led to an unprecedented spike in hate violence and mosque attacks, intense radicalization of white supremacists, and a shocking disregard for the lives of American Muslims.”

The three men were indicted in October 2016 and their trial lasted four weeks. They will be sentenced June 27 and could face up to life in prison.

CNN’s Joe Sutton contributed to this report.