Three men accused of plotting a “bloodbath” of Somali immigrants in a small Kansas town in order to provoke a religious war appeared in court on Monday and were ordered to remain in custody.

Patrick Stein, Curtis Allen and Gavin Wright are suspected of planning a domestic terrorist attack to destroy an apartment complex that is home to about 120 Somali people in Garden City.

The men were charged last week with conspiring to use a weapon of mass destruction and face up to life in prison if convicted.

Since February, the FBI has conducted an investigation into a small anti-government, anti-immigrant, anti-Muslim militia group in south-west Kansas called the Crusaders, according to the criminal complaint.

The trio met on 14 August and decided they would blow up the complex with four explosive-laden vehicles – one on each corner – because a large Somali community lives there and uses one of the apartments as a mosque, the complaint alleged.

Garden City, 210 miles west of Wichita, has a diverse population of about 27,000 people, many working at a meatpacking plant. It has previously been cited as a successful example of the rapid assimilation of a multicultural population into a rural area.

“This presented an escalated level of planned violence that we [in Kansas] have not experienced before,” said Moussa Elbayoumy, the board chairman of the Kansas chapter of the Council on American-Islamic Relations. He said the thwarted attack “confirms what we’re hearing from law enforcement authorities all along, that the biggest threat to safety and security in the US is not from Muslim terrorists or anything like that, it’s mostly from homegrown militia-type terrorists”.

After the August meeting, authorities said, the group began to formulate more detailed plans about how to source materials and carry out the attack while evading detection. The carnage would take place at prayer time for maximum loss of life.

All the accused are in their late 40s. One of the plotters, Allen, works at a mobile home business owned by Wright, authorities said. The complaint says the suspects and their communications were monitored and recorded by an informant. It contains numerous disturbing details about their alleged fantasies and schemes. Stein described Somali people as “cockroaches” who needed to be eliminated, court documents say.

Allen is said to have suggested making signs that say “I support illegal immigration, I go against the constitution on a daily basis”, and then “for every one of them [Somalis] that we blow the top of their head off we just put that around their neck”.

On other occasions, Stein is said to have suggested carrying out an attack against Muslim refugees in Garden City in retaliation for the Orlando nightclub mass shooting and to have floated the ideas of blowing up apartments using rocket-propelled grenades, kicking in doors of homes where Somali people lived and shooting them one by one, firing at them with a bow and arrow dipped in pig’s blood, and burning down churches that have helped refugees.

“The only fucking way this country’s ever going to get turned around is it will be a bloodbath,” Stein allegedly said.

At another time, he reportedly said: “The only good Muslim is a dead Muslim” and “If you’re a Muslim I’m going to enjoy shooting you in the head … When we go on operations there’s no leaving anyone behind, even if it’s a one-year-old. I’m serious. I guarantee if I go on a mission those little fuckers are going bye-bye.”

During a meeting in July, the complaint said, the men discussed a wide range of targets they believed were Muslims or sympathetic to Muslims, and Wright “pulled up Google Maps on the computer at his business and began dropping pins on the map at these various locations using the label ‘cockroaches’ … The group brainstormed various methods of attack, including murder, kidnapping, rape, and arson.”

Allen was arrested in the Kansas city of Liberal on 11 October after his girlfriend contacted local police to say he had physically attacked her during an argument. Police said they found a large amount of ammunition in his car and close to 1,000kg (2,200lbs) worth of ammunition at his home. Later that day, the woman told the FBI that within the past two weeks she had watched Allen make what appeared to be homemade explosives.

On 12 October, with Allen’s arrest putting the plot under pressure, Stein allegedly met with someone he believed could supply guns and bomb components and tried out two automatic rifles in a rural location near Garden City. But the supplier was an undercover FBI employee and the weapons came from an FBI laboratory in Quantico, Virginia.

Detention hearings for Stein and Wright were set for Friday and for Allen next Monday. Their attorneys declined to comment after the hearing.