Three men in the US have been charged with planning to blow up a Kansas mosque and apartment complex in a plan to "wake people up".

Curtis Allen and Gavin Wright, both 49, and of Liberal, Kansas, and Patrick Eugene Stein, 47, of Wright, Kansas, appeared in federal court facing charged of conspiring to use explosives to attack an apartment and place of worship used by a large number of Somali immigrants in Garden City.

A complaint alleges the FBI has been investigating the men and their activities, including the alleged plan to attack Muslims in Kansas since February 2016.

The men were accused of being a part of a white militia group called The Crusaders, whose meetings were attended by a confidential source who provided the FBI with information.

"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," said Acting U.S. Attorney Tom Beall of the District of Kansas.

"Many Kansans may find it as startling as I do that such things could happen here."

The men are accused of discussing an attack they allegedly said would "wake people up" in which they allegedly discussed planning to fill four cars with explosives and parking them at four corners of the apartment used by the Somalis, in order to create a large explosion, the US Department of Justice said.

"According to the complaint, these three defendants conspired to conduct a bombing attack against an apartment complex occupied by men, women and children in the Garden City, Kansas community," said Assistant Attorney General for National Security John P. Carlin.

"Protecting our nation from such attacks, whether they are rooted in domestic or international terrorism, is our highest priority."