MORRISTOWN, N.J. (Reuters) - President Donald Trump said on Thursday he supports meaningful background checks for gun buyers, but he said that those responsible for recent mass shootings were mentally ill and the United States should build more mental institutions.

Trump said he had been speaking with Senate majority leader Mitch McConnell and many other Republicans about the problem of gun violence, and “they don’t want to have insane people, dangerous people, really bad people having guns.”

“We don’t want crazy people owning guns,” the president told reporters in Morristown, New Jersey. “It’s them. They pull the trigger. The gun doesn’t pull the trigger. They pull the trigger. So we have to look very seriously at mental illness.”

Trump is under pressure to curb gun violence following two mass shootings that killed dozens of people this month in Texas and Ohio. His comments came as he started a trip from New Jersey to address a campaign rally in New Hampshire.

“We’re looking at the whole gun situation,” Trump said when asked whether he was pressing Republicans on tougher background checks for gun buyers.

Later on Thursday at a rally in Manchester, New Hampshire, Trump said it was necessary to consider building new institutions for the mentally ill.

“We have to do it. At the same time we will be taking mentally deranged and dangerous people off of the streets so we won’t have to worry so much about that. It’s a big problem,” he said.

In his comments in New Jersey, Trump said many U.S. mental institutions were closed in the 1960s and 70s and their patients released onto the streets.

“We can’t let these people be on the streets,” he said.

A move toward deinstitutionalization for the mentally ill began in the 1960s. It gathered force with court rulings in the 1970s. In a landmark case in 1975, the U.S. Supreme Court ruled that a person had to be a danger to himself or to others to be confined.