President Trump said Saturday that people who commit mass shootings, including Saturday's shooting at a Pittsburgh synagogue, should receive the death penalty.

"When people do this, they should have the death penalty," Trump said, speaking to reporters after his motorcade arrived at Joint Base Andrews.

[Jim Mattis: Pittsburgh synagogue shooter the 'poorest excuse for a man']

At least 10 people were killed during the shooting, where worshipers had reportedly gathered for a bris at the Tree of Life Synagogue. Police have a suspect in custody, and four officers were injured as they worked to rescue the people inside the synagogue.

Trump, who referred to the gunman as a "madman" and a "wacko," lamented that these types of cases can take years to make their way through appeals, and said laws on capital punishment should be more harsh.

"They should pay the ultimate price. I have felt that way for a long time," he said.

The president floated the possibility that houses of worship should have armed guards for protection.

"If they had some kind of protection inside the temple, maybe this could have been a very different situation," he said.

Trump has backed the possibility of teachers carrying guns to stop mass shootings in schools.

"I hate to think of it that way," Trump said, when questioned by reporters about gun laws. "It's certainly an option.

"Certainly, you want protection, and they had a maniac walk in, and they didn't have any protection," Trump said.

He said he would issue a formal statement later in the day at a Future Farmers of America event in Indianapolis, where he is scheduled to take the stage at 2:45 p.m.