Updated

President Donald Trump mourned the dead and forcefully condemned anti-Semitism after a mass shooting at a Pittsburgh synagogue that left 11 dead. But faced with another national tragedy, he did not long turn his focus away from the midterm elections or himself.

Nine days from elections that will determine the control of Congress, Trump stuck to his plans to appear at an agricultural convention and a political rally Saturday. Throughout the day, he expressed sorrow, called for justice and bemoaned hate, getting regular updates on the shooting. But he also campaigned for candidates, took shots at favorite Democratic targets House Minority Leader Nancy Pelosi and Sen. Elizabeth Warren and made jokes about his hair.

At a massive rally in southern Illinois for U.S. Rep. Mike Bost, Trump condemned the shooting as an "evil anti-Semitic attack." But he said cancelling his appearance would make "sick, demented people important." He pledged to change his tone for the evening and did cool some of his most fiery rhetoric.

The slaughter at Sabbath services followed a tense week dominated by a mail bomb plot with apparent political motivations and served as another toxic reminder of a divided nation. It also again underscored Trump's reluctance to step into the role of national unifier at tense moments as well as his singular focus heading into elections that could dramatically change his presidency.

Trump acknowledged the weight these moments carry, telling reporters that experiencing such events as president, "it's a level of terribleness and horror that you can't even believe. It's hard to believe."

The White House said Trump was getting regular briefings on the attack. He spoke with the governor of Pennsylvania and the mayor of Pittsburgh. He also spoke with his daughter Ivanka Trump and her husband, Jared Kushner, who are Jewish.

Shortly after returning to Washington late Saturday, Trump ordered flags at federal buildings throughout the country to be flown at half-staff until Oct. 31 in "solemn respect" for the victims.

Trump sought to energize turnout for Bost, who is fighting to hold on to a seat that was once a Democratic stronghold, but turned out for Trump in 2016. To bolster his argument for sticking with the rally, Trump argued that the New York Stock Exchange was opened the day after 9/11, though in fact it was re-opened on September 17.

Speaking to a massive, cheering crowd at an airport hangar in southern Illinois, Trump said "the hearts of all Americans are filled with grief, following the monstrous killing." He told reporters before the rally that he would travel to Pittsburgh, though he did not offer details. He also sought to distance himself from the man arrested in the shooting, calling him "sick" and saying "he was no supporter of mine."

Although his tone was softer, he still targeted Pelosi and Democrats and the crowd gleefully shouted "lock her up," in reference to Hillary Clinton, one of the targets of the bomb plot. And he continued to emphasize his hardline immigration rhetoric. "Republicans want strong borders, no crime, and no caravans," Trump said.

Trump's speech to a convention of the Future Farmers of America had all the hallmarks of a Trump rally, as the president riffed on trade, jobs and some of his political enemies. At one point he also joked about his hair. He said it was ruffled by the rain as he left Washington, adding "I said, 'maybe I should cancel this arrangement because I have a bad hair day."

Trump offered an unsparing denunciation of anti-Semitism, which he said was the motive behind the attack, in contrast to remarks after clashes between white supremacists and counterprotesters in Charlottesville last year. Then, he only inflamed tensions by blaming both sides for the violence.

Speaking to young farmers in Indianapolis, Trump called on the country to come together, before inviting a pastor and rabbi on stage to pray.

Earlier in the day, Trump speculated that the death toll in Pittsburgh would have been curbed if an armed guard had been in the building. With both the number of deaths and details of the synagogue's security still to be disclosed, Trump said gun control "has little to do with it" but "if they had protection inside, the results would have been far better."

But the attack did not persuade him that tighter gun controls are needed.

"This is a case where, if they had an armed guard inside, they might have been able to stop him immediately," Trump said. "Maybe there would have been nobody killed, except for him, frankly. So it's a very, very - a very difficult situation."

In previous mass shootings, Trump has at times said he would consider tightening gun laws but in the main has called for more armed guards in places such as schools.

"The world is a violent world," he said before his speech. "And you think when you're over it, it just sort of goes away, but then it comes back in the form of a madman, a wacko. ... They had a maniac walk in and they didn't have any protection and that is just so sad to see, so sad to see."

Trump said lawmakers "should very much bring the death penalty into vogue" and people who kill in places such as synagogues and churches "really should suffer the ultimate price."

___

For AP's complete coverage of the Pittsburgh synagogue shootings: https://www.apnews.com/Shootings