People stand outside an Islamic mosque located within an apartment complex, which federal authorities allege was to be targeted in a bomb plot by three Kansas men, is seen in Garden City, Kansas, U.S. October 14, 2016. REUTERS/Adam Shrimplin

News and research before you hear about it on CNBC and others. Claim your 2-week free trial to StreetInsider Premiumhere.

By Kevin Murphy

KANSAS CITY, Kan. (Reuters) - Three men charged with plotting to bomb an apartment building in western Kansas where Muslim immigrants from Somalia lived and had a mosque pleaded not guilty on Monday but remained in jail, prosecutors said.

Curtis Allen, 49, Gavin Wright, 49, and Patrick Eugene Stein, 47, were each charged on Friday with one count of conspiring to use a weapon of mass destruction in Garden City, Kansas.

The three were arraigned in federal court in Wichita on Monday, where lawyers entered not guilty pleas on their behalf, said James Cross, spokesman for Tom Beall, acting U.S. attorney for the District of Kansas.

Wright and Stein will have detention hearings on Friday and Allen next week to determine if they should remain in jail while the case is pending, Cross said. If convicted, the defendants face a maximum sentence of life in federal prison.

Stein's lawyer, Edward Robinson, and Wright's lawyer, Kari Schmidt, did not immediately return calls seeking comment. Kirk Redmond, public defender for Allen, also did not return a call.

The three men are accused of stockpiling guns and explosives in preparation for bombing an apartment complex where 120 people lived, including the Somalians.

They 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.

The men were being investigated as part of a domestic terrorism probe of several militia groups in southwestern Kansas, according to an FBI affidavit accompanying the charges. Those groups had anti-government, anti-Muslim and anti-immigration beliefs, the affidavit said.