WICHITA, Kan. — Three men accused of conspiring to bomb a Kansas mosque and an apartment complex housing Somali refugees also allegedly discussed killing the refugees’ white landlord because he rented to Muslims, a move prosecutors say was meant to ensure the attack fully conveyed their anti-Muslim message.

Details of the alleged plot emerged in government filings in advance of an upcoming detention hearing Wednesday for Gavin Wright. His attorney has argued that Wright was unaware his co-defendants intended to actually carry out the attack, portraying him as a lonely man desperate to find friends after moving to Liberal, a city along southwestern Kansas’ border with the Oklahoma Panhandle.

But prosecutors countered Wednesday with court filings that include transcripts of profanity-laced recordings that paint a more damning picture of Wright and a splinter group of the militia Kansas Security Force that came to be known as “the Crusaders” — based on the name “Crusaders 2.0” that they gave to themselves on a phone messaging app.

Prosecutors say the defense mischaracterizes the danger Wright presents if freed before trial. They allege that he manufactured and tested the homemade explosives and hosted group meetings at his business, G&G Mobile Home Center, where authorities later found explosives.

They also cite a meeting last August in which an apartment complex in Garden City, a meatpacking town about 60 miles north of Liberal, was picked as a target. Before that meeting, each man put his cellphone in a separate room to avoid surveillance and Wright locked the front door so no one could walk in on them, the government contends.

The men didn’t know that one member was wearing a wire as part of a federal investigation into the Crusaders.

Transcripts of the secretly recorded gatherings show the group talked about chemicals to make homemade explosives and how best to order them to avoid drawing suspicion from law enforcement. They pulled up Google Earth on Wright’s computer to look at images of potential targets. They discussed setting off the blast at prayer time to kill as many Muslims as possible.

“Oh hell yes, you’ll have everybody in that whole complex in that prayer room, I guarantee you that,” Wright is quoted in a transcript as saying.

During that meeting, Wright also suggested that they kill the landlord who owned the complex to send a message: “any of you people rent to these m———– we’re going to start knocking you all off.”

Wright and co-defendants Patrick Stein and Curtis Allen are charged with conspiracy to use a weapon of mass destruction and conspiracy against civil rights for an attack planned for the day after the November 2016 election. Wright also faces a charge of lying to the FBI. The three men, who were indicted in October, have pleaded not guilty.

Wright also is quoted in a transcript saying he hoped the attack would “wake people up” and inspire others to take similar action against Muslims.

Stein allegedly agreed: “This is just a beginning.”