Three men who were convicted of plotting to blow up a Kansas apartment complex where Somali refugees lived have each been sentenced to at least 25 years in prison, the Justice Department said on Friday.

“The defendants in this case acted with clear premeditation in an attempt to kill innocent people on the basis of their religion and national origin,” Matthew G. Whitaker, the acting United States attorney general, said in a statement. “That’s not just illegal — it’s morally repugnant.”

During the trial last year in Wichita, Kan., prosecutors portrayed the men as aspiring domestic terrorists who were preparing to bomb the apartment complex in Garden City, Kan., which is home to a makeshift mosque and a community of Somali immigrants. The men, who called themselves “the Crusaders,” were arrested about four weeks before Nov. 9, 2016, the date they had picked for the bombing.

Prosecutors said the men had also considered attacks on other targets, including elected officials and churches that helped refugees. In secretly recorded conversations, the men could be heard making demeaning comments about Muslims; one called them “cockroaches.”