Mayor Lori Lightfoot on Monday accused President Donald Trump of “blowing every racist, xenophobic dog whistle” and said, “When you do that, animals come out.”

And Gov. J.B. Pritzker followed suit, saying Trump has “created an environment in which people have felt that it’s OK to attack people of color and immigrants in particular.”

Lightfoot laid the blame for mass shootings in El Paso, Texas, and Dayton, Ohio squarely at the president’s feet.

Trump didn’t pull the trigger of the automatic weapons that left 31 people dead and dozens wounded in both cities. But Lightfoot contended the president essentially set the fire with his hateful rhetoric and provocative, us-against-them tweets.

“As the leader of our country, I implore the president to set a better, clearer moral tone because what he’s been doing is blowing every racist, xenophobic dog whistle. When you do that — when you blow that kind of dog whistle — animals come out,” the mayor said.

Lightfoot urged the president to use “not just the bully pulpit of his office, but his weight in Congress” to finally defy his powerful allies in the National Rifle Association and deliver what she called “common sense gun reform.”

“If the president weighs in, if he shows these Republicans that they can actually have courage, we can get this done. But if he stands back and he continues to do what he’s been doing and he just tweets and he demonizes and he skims the surface, it matters not,” she said.

Pritzker said he met with senior staffers over the weekend to address gun control in Illinois, but he said Congress and the president must “stand up and address the issue of gun violence, to address the issues of high speed high capacity magazines, to address the issues of universal background checks.”

“The president seems to like to pretend that he’s going to do something about it, and then he does nothing about it or reverses himself on it,” Pritzker said. “So we need action. We need action now.”

On Monday, Trump condemned the weekend shootings as crimes “against all humanity” and vowed to act “with urgent resolve” to deliver “strong background checks” for gun users.

But the president also made it clear that he would oppose sweeping gun-control legislation championed by Democrats, arguing that “mental illness and hatred pulls the trigger — not the gun.”

Lightfoot argued that the president’s response missed the mark.

“These dismissals of, `Well, that’s just some crazy person,’ which is what he’s seemingly doing, completely undermines the realities of what’s happening out there,” she said.

“He trivializes the mental health concerns and realities of people in every community. That doesn’t help with what’s necessary in the first instance, which is destigmatizing mental health issues so people feel like they have a safe space to talk about themselves, to talk about family members, to talk about what’s going on in their communities. That’s what we need. That’s what leadership would look like.”

The mayor was asked how much of an emphasis there should be on spotting, what Trump has called “red flags,” people who have been flagged for exhibiting violent behavior or having violent tendencies.

“How do you have a red flag if you don’t have universal background checks? How do you have a red flag if you have this patchwork of state regulations that are not uniform? We are very different in Illinois than we are in Indiana and we’re neighbors. Same thing with Wisconsin and Michigan,” she said.

“That’s why we need the federal government to step up and do its job to fill these voids. Of course we shouldn’t allow people who have a demonstrated track record of violence or mental illness to have guns. But that becomes increasingly difficult when every state has a different set of rules and people can travel and purchase firearms at an alarming rate.”