President Trump on Saturday strongly condemned the deadly mass shooting at a Pittsburgh synagogue as “pure evil” and anti-Semitic, and then, without skipping a beat, slipped into campaign mode with attacks on trade deals, a discourse on palm trees and a dig at a potential 2020 rival.

Just over a week before midterm elections, the president traveled to Indiana for a convention speech and later a political rally in Illinois, though he joked about canceling both events because of a “bad hair day.”

“This wicked act of mass murder is pure evil, hard to believe and frankly something that is unimaginable, our nation and the world are shocked,” Trump told the audience at the National FFA Organization event, adding that the “vile, hate-filled poison of anti-Semitism” must be rejected, as should all prejudice.

The president said that the shooting that left at least 11 dead and six wounded occurred at a baby-naming ceremony, which happens when an infant is eight days old.

It was the second time in less than a week that a horrific act shocked the nation — law enforcement arrested and charged a Florida man with sending mail bombs to prominent Democrats on Friday — and Americans awaited the president’s words of comfort and reassurance.

Upon arriving in Murphysboro, Ill., Trump said he would travel to Pittsburgh, though he did not offer specifics on timing. He also defended his campaign schedule, saying, “we cannot let our schedule or our lives change.”

His appearance came on behalf of Rep. Mike Bost (R-Ill.), who is locked in a close race, and Trump called the midterms “the most important . . . perhaps ever.”

The president praised Bost and warned that electing Democrats would result in Minority Leader Nancy Pelosi (Calif.) becoming speaker. He also mentioned a frequent target of his criticism, Rep. Maxine Waters (Calif.), who was among the Democrats who were the intended recipients of the bombs.

His recollection of the 2016 campaign and win over Hillary Clinton also elicited chants of “Lock her up.”

In Indiana, Trump opened his remarks by speaking out against political violence and anti-Semitism. But he segued into his favorite topics, and the rally here had the incongruous feel of a somber tribute to yet another mass shooting in America and a campaign rally complete with cheers, put-downs and an upbeat soundtrack, including a version of the song “Happy” by Pharrell.

After pleading for peace and harmony, Trump seemingly couldn’t resist reverting to his favorite political insults. He criticized the trade deals of past presidents and boasted about his actions on ethanol. Trump attacked Sen. Elizabeth Warren (D-Mass.) and her claim to Native American heritage, speculating she might be “out” of consideration for president.

“Turned out that I had more Indian blood in me than she has,” Trump said. “What a sad event. And I have none, so you know.”

As the crowd of students laughed, Trump shrugged: “We can’t resist. Can we resist?”

Trump took the stage to Lee Greenwood’s “God Bless the USA,” standing for a moment before the cheering crowd. Trump kept to his Saturday schedule.

“These are bad people. You can’t allow them to dominate what we do,” Trump said, referring to perpetrators of attacks like the one on the Pittsburgh synagogue. “So, I’ll go. Not that I want to go, but I think that I actually, in reverse, have an obligation to go.”

Sen. Robert P. Casey Jr. (D-Pa.) canceled get out the vote efforts on Saturday, and Gov. Tom Wolf (D) cleared his schedule and went to Pittsburgh.

Trump also suggested that he should have skipped his trip because his hair looked bad after speaking to reporters in the rain at Andrews Air Force Base in Maryland about the shooting.

“The wind was blowing and the rain, and I was soaking wet, and that’s what I ended up with today,” Trump said. “And I said maybe I should cancel this arrangement because I have a bad hair day.”

Trump then talked about the robustness of the American military, recovery for Southern farmers whose crops were destroyed by Hurricanes Florence and Michael, and Jimmy Carter. “He was a peanut farmer,” Trump said, and a “very nice man.”

He also discussed how palm trees don’t get knocked down during storms and touted the nation’s strong military and gains he said were made during his presidency.

Trump brought two Indiana House members on stage. Each briefly spoke about how excited they were to work with the president and did not mention the synagogue shooting.

“Please get out and vote for them,” Trump said.

Earlier in the day, when asked whether he should revisit gun laws, Trump said, “this has little to do with it if you take a look. If they had protection inside, the results would have been far better.”

Trump has regularly suggested after numerous mass shootings that armed people could have averted bloodshed, even though armed officials are often present. Officials in Pittsburgh said four police officers were shot and wounded by the gunman, identified by police as 46-year-old Robert Bowers.

The president also called for stiffer laws and complained about the due process in death penalty convictions.

“I think they should very much bring the death penalty into vogue. Anybody that does a thing like this to innocent people that are in temple or in church — we had so many incidents with churches — they should be — they should really suffer the ultimate price.”

When asked if he thinks that all churches and synagogues should have armed guards, Trump said it is “certainly an option.”

Mark Berman contributed to this report.