President Trump responded Saturday to a fatal shooting at a Pittsburgh synagogue that left at least eight dead. He said the outcome might have been different if the synagogue, which is located in a neighborhood known for its Jewish population, had "protection."

"If there was an armed guard inside the temple, they would have been able to stop him, maybe there would have been nobody killed, except for him, frankly," Mr. Trump said.

"If they have some kind of protection inside the temple maybe it could have been a very much different situation. They didn't," he said.

Get Breaking News Delivered to Your Inbox

He also said "we should stiffen up our laws in terms of the death penalty."

"When people do this they should get the death penalty," he said. "And they shouldn't have to wait years and years. ... And, I think they should very much bring the death penalty into vogue."

Mr. Trump, speaking to reporters at Andrews Air Force Base, said the violence "has to stop."

It's a "terrible thing what's going on with hate in our country," he said.

City officials said the shooting was being investigated as a federal hate crime. It comes amid a rash of high-profile attacks in an increasingly divided country, including the series of package bombs mailed over the past week to prominent Democrats and former officials.

In addition to those who were killed Saturday, six were wounded, including the four police officers, said Wendell Hissrich, the Pittsburgh public safety director.

"This is likely the deadliest attack on the Jewish community in the history of the United States," Jonathan Greenblatt, CEO of the Anti-Defamation League, said in a statement.

The attack took place during a baby naming ceremony, according to Pennsylvania Attorney General Josh Shapiro. It was unknown whether the baby was harmed.

World Jewish Congress President Ronald S. Lauder called the shooting "an attack not just on the Jewish community, but on America as a whole."

The synagogue where the shooting took place is located in a tree-lined residential neighborhood of Squirrel Hill, the hub of Pittsburgh's Jewish community. In 2010, Tree of Life Congregation -- founded more than 150 years ago -- merged with Or L'Simcha to form Tree of Life (asterisk) Or L'Simcha.

The synagogue is a fortress-like concrete building, its facade punctuated by rows of swirling, modernistic stained-glass windows illustrating the story of creation, the acceptance of God's law, the "life cycle" and "how human-beings should care for the earth and one another," according to its website. Among its treasures is a "Holocaust Torah," rescued from Czechoslovakia. Its sanctuary can hold up to 1,250 guests.

Michael Eisenberg, the immediate past president of the Tree of Life Synagogue, lives about a block from the building.

He was getting ready for services when he received a phone call from a member who works with Pittsburgh's Emergency Services, saying he had been notified through scanner and other communications that there was an active shooter at their synagogue.

"I ran out of the house without changing and I saw the street blocked with police cars. It was a surreal scene. And someone yelled, 'Get out of here.' I realized it was a police officer along the side of the house. ... I am sure I know all of the people, all of the fatalities. I am just waiting to see," Eisenberg said.

He said officials at the synagogue had not gotten any threats that he knew of prior to the shooting. The synagogue maintenance employees had recently checked all of the emergency exits and doors to make sure they were cleared and working.

"I spoke to a maintenance person who was in the building and heard the shots. He was able to escape through one of the side exit doors we had made sure was functioning," Eisenberg said.

Jeff Finkelstein of the Jewish Federation of Greater Pittsburgh said local synagogues have done "lots of training on things like active shooters, and we've looked at hardening facilities as much as possible."

"This should not be happening, period," he told reporters at the scene. "This should not be happening in a synagogue."