Pittsburgh mayor Bill Peduto said he quickly ended a call with President Donald Trump when all the president wanted to talk about was the death penalty.

He said Trump called him as he was still on his way to the scene of the shooting at Tree of Life synagogue.

Capital punishment doesn't deter crimes, according to numerous studies.

Peduto also linked the attack to Trump's incendiary rhetoric about the migrant caravan weeks away from the United States border.

Pittsburgh mayor Bill Peduto said President Donald Trump wanted to talk about only one thing after the Tree of Life synagogue shooting on October 27: the death penalty.

Minutes after news of the shooting, as law enforcement officials raced to the synagogue, Trump called Peduto. After offering his thoughts and prayers, Trump insisted on discussing harsher death penalty legislation to deter mass shooters.

Peduto quickly ended the conversation to focus on handling the emergency and mourning the dead, he told the Washington Post.

"I'm literally standing two blocks from 11 bodies right now. Really?" Peduto said. [Talking about capital punishment wasn't] going to bring them back or deter what had just happened... I ended the conversation pretty quickly after that."

Trump tweeted a demand Capital punishment does not deter murder or any other crimes, according to numerous studies.

First lady Melania Trump and President Donald Trump visited Pittsburgh after the shooting. AP Photo/Andrew Harnik

The death penalty is legal but rare in the state of Pennsylvania; the state hasn't executed anyone since 1999. Federal Justice Department officials are seeking the death penalty for Robert Bowder, who was charged with killing 11 people in the synagogue shooting.

Peduto is from a neighborhood near Pittsburgh's Squirrel Hill area, less than a mile from where the shooting took place. He represented the district on Pittsburgh's city council for 12 years before becoming mayor in 2014. He told The Washington Post that he had personal connections to family members of people killed in the shooting.

A vigil for the shooting victims. Jeff Swensen/Getty Images

The Democratic mayor linked the antisemitic attack to Trump's apocalyptic rhetoric about the migrant caravan weeks away from America's border.

"This obviously was somebody whose decision to kill Jewish people was based on what he was reading, with news of migrants who are trying to escape the hell they are in and potentially on their way to the United States," he told The Washington Post. "And somehow that story has become butchered into a story of an invading army and then that story being manipulated that it’s the Jews that are doing it and they’re financing it... Then this guy wakes up on a Saturday morning armed to the gills with bullets and guns to kill as many Jewish people as he possibly can."

Read more: Here's exactly how the Pittsburgh synagogue shooting unfolded.

Peduto has been at loggerheads with the president over policy before. When Trump pulled out of the Paris Climate Agreement in 2017, he announced he was "elected to represent the citizens of Pittsburgh, not Paris." Peduto said his city would continue to follow the agreement anyway.

"As the Mayor of Pittsburgh, I can assure you that we will follow the guidelines of the Paris Agreement for our people, our economy & future," he tweeted.