WICHITA, Kan. (Reuters) - 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 prosecutor said on Thursday.

FILE PHOTO: Curtis Allen 49, (L to R), Gavin Wright, 49 and Patrick Eugene Stein, 47 are shown in these booking photos in Wichita, Kansas provided October 15, 2016. Photo courtesy of Sedgwick County Sheriff's Office/Handout via REUTERS/File Photo

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. Wright also faces weapons-related charges and Stein 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.

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

“Defendants wanted to plant the message Muslims are not welcomed here - not in Garden City, not in Kansas, not in America,” prosecutor Risa Berkower said in opening statements of the trial in federal court in Wichita, Kansas.

Berkower said the men were members of the Kansas Security Force, which she described as a militia group. They had formed a splinter group known as “the Crusaders” to “kill as many Muslims as they could” and “to make Muslims uncomfortable in this country,” she added.

The defendants had tried unsuccessfully to recruit other militia members to join them, Berkower said. One of the men who had been approached told the FBI of the plan, she said.

However, the attorney for Stein, James Pratt, said federal agents took advantage of his client.

“Patrick Stein at times has allowed his prejudice and hate to consume him,” Pratt said in his opening statement. “The federal government saw an opportunity to exploit Patrick Stein’s fears.”

He also said the FBI’s informant was the one providing maps and aerial views of the apartment complex and all of those were ultimately supplied by the FBI.

“The FBI created and directed all of this,” said Richard Federico, the attorney for Allen.

Federal, state and local authorities investigated the plot for eight months as the three conducted surveillance and 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 southwestern Kansas.

Allen and Wright are from Liberal, Kansas, and Stein is from Wright, Kansas.