Three men charged with plotting to bomb an apartment complex in western Kansas, where Muslim immigrants from Somalia lived and had a mosque, wanted to kill as many as possible and send a message they were not welcome in the United States, a federal prosecutor said at their trial on Tuesday.

Prosecutors charged Curtis Allen, Gavin Wright and Patrick Eugene Stein each with conspiring to use a weapon of mass destruction in Garden City, Kansas, and conspiring to deny others’ civil rights. Stein also faces weapons-related charges, and Wright is charged with lying to the FBI.

Officials have said the men, who face life in prison if convicted, were members of a militia group.

“Their ultimate goal was to wake people up and to slaughter every man, woman and child in the building,” assistant US attorney Anthony Mattivi said in his closing argument in federal court in Wichita on Tuesday.

“There’s no doubt that these three defendants were deep in the heart of a violent conspiracy,” he added.

The defendants, all white men, pleaded not guilty after they were indicted in October 2016. Defense attorneys have said their clients were entrapped by the federal government.

Prosecutors have said the men were members of a militia group called the Kansas Security Force and formed a splinter group, “the Crusaders”.

The defendants tried unsuccessfully to recruit other militia members to join them, prosecutors have said. One of the men who was approached told the FBI of the plan.

However, the attorneys for the defendants have said federal agents took advantage of their clients. Allen’s defense attorney, Melody Brannon, said on Tuesday the informant who aided the FBI was the one who provided all the maps and aerial views of the apartment complex, and even encouraged the use of bombs.

“The FBI was out to get a headline, to make an example out of these men,” Brannon said in court.

Kari Schmidt, Wright’s defense attorney, added: “In America, we don’t imprison people for their thoughts and words. There were no bombs.”

Federal, state and local authorities investigated the plot for eight months as the three stockpiled guns and explosives in preparation for bombing an apartment complex where 120 people lived including the Somalians, according to the charges.

The men intended to park a vehicle at each corner of the apartment complex and detonate them, according to the charges. Garden City is a town of about 27,000 people in south-western Kansas.