The men had talked about filling four vehicles with explosives and parking them at the four corners of the apartment complex in Garden City to create a large explosion, the DOJ said in a news release.
About 120 Somali immigrants live in the complex, CNN affiliate KWCH reported
, and acting US Attorney Tom Beall said one of the apartment units served as a mosque.
The trio, members of a militia group that calls itself The Crusaders, wanted to "wake people up," the DOJ said. They were stockpiling weapons and planned to release a manifesto after the explosion, Beall said at a news conference.
"These charges are based on eight months of investigation by the FBI that is alleged to have taken the investigators deep into a hidden culture of hatred and violence," acting US Attorney Tom Beall said. "Many Kansans may find it as startling as I do that such things could happen here."
Curtis Allen and Gavin Wright, both 49, of Liberal, Kansas, and Patrick Eugene Stein, 47, of Wright, Kansas, were charged with conspiring to use a weapon of mass destruction.
A confidential source attended meetings of The Crusaders and told the FBI about the men's plans, the DOJ said.
Stein met with an undercover FBI employee Oct. 12 and test-fired automatic weapons, the DOJ said. Stein took the source to the apartment building the men allegedly planned to bomb and said he would provide ammonium nitrate for the bomb and contribute $200 to $300 for other materials, the DOJ said.
Stein also mentioned that Allen had been arrested in a domestic violence case, causing Stein to worry Allen's girlfriend would talk to police about their plans, the DOJ said.
'Disturbing terror plot'
If convicted, the men could be sentenced to life in prison, the DOJ said.
Hillary Clinton issued a statement congratulating law enforcement "for detecting and disrupting a highly disturbing terror plot" that she said was an affront to all Americans.
"We all must stand firm in fighting terror and rejecting hateful and divisive rhetoric -- and we must do it together," Clinton said.
The Democratic presidential nominee said if elected she would "work with law enforcement at all levels and within our communities to make sure we have the tools we need to prevent both domestic and international terrorist threats."
Garden City, a town of about 27,000 people, and Finney County have attracted immigrants for years because they can find work in the meatpacking factories, CNN reported in 2009
Between 2007 and 2008, Finney County became a majority-minority community, the US Census Bureau said.
Preliminary data from the Council on American-Islamic Relations indicates that 2016 is on track to be the second-worst year on record when it comes to mosque attacks in the United States.
This year is barely trailing the record set last year: 78 mosques were attacked in 2015.