A judge on Wednesday ordered the accused murderer of 20-year-old Iowa college student Mollie Tibbetts held in lieu of $5 million bail — as his lawyer claimed, without evidence, that his client is not an illegal immigrant.

It was the first public appearance for Cristhian Bahena Rivera, 24, a Mexican who appears to have used a stolen ID to pose as a legal immigrant and work for the past four years on the cattle farm of a prominent Iowa Republican.

Investigators say Rivera has confessed to kidnapping Tibbetts as she jogged past farmland a month ago, leaving her body to rot in a field in Poweshiek County, hidden under cornstalks.

The crime devastated the young woman’s family — “Our hearts are broken,” members said in a statement Wednesday — and inspired President Trump to reiterate his tough-on-immigration stance.

“Mollie Tibbetts an incredible young woman, is now permanently separated from her family,” Trump said in a video statement tweeted Wednesday night.

“A person came in from Mexico, illegally, and killed her,” he wen on.

“We need the wall. We need our immigration laws changed, we need our border laws changed. We need Republicans to do it because Democrats aren’t going to do it.”

Trump’s statement prompted Rivera’s defense lawyer to seemingly mock the president in a court filing seeking a media gag.

“Sad and sorry Trump has weighed in on this matter in national media which will poison the entire possible pool of jury members,” the lawyer, Allan Richards, wrote.

Richards is also claiming that Rivera is a legal immigrant who came to the United States as a minor and who has only a seventh- or eighth-grade education.

Rivera had been in good standing as an employee, Yarrabee Farms President Eric Lang told The Associated Press — adding that the suspect even passed an extra layer of vetting, through the Department of Homeland Security’s E-Verify system, which cross-referenced his ID with DHS and Social Security records.

Lang the brother of Craig Lang, a farmer who recently lost the 2018 Republican primary for state agriculture secretary.

A law-enforcement source countered in The Washington Post that Rivera used a stolen ID.

Rivera, meanwhile, sat through a bail hearing wearing handcuffs and earphones for a Spanish interpreter’s translation.

“Please remember, Evil comes in EVERY color,” Tibbitts’ aunt, Billie Jo Calderwood, said on Facebook Wednesday in an apparent counterpoint to hard-line tough-on-immigration rhetoric.