WASHINGTON — When shots rang out last year at a high school in Parkland, Florida, leaving 17 people dead, President Trump quickly turned his thoughts to creating more mental institutions.

When back-to-back mass shootings in Dayton, Ohio, and El Paso, Texas, jolted the nation earlier this month, Trump again spoke of "building new facilities" for the mentally ill as a way to reduce mass shootings.

"We don't have those institutions anymore and people can't get proper care," Mr. Trump lamented at a New Hampshire campaign rally not long after the latest shootings.

Get Breaking News Delivered to Your Inbox

Now, in response to Mr.Trump's concerns, White House staff members are looking for ways to incorporate the president's desire for more institutions into a long list of other measures aimed at reducing gun violence.

It's the latest example of White House policy aides scrambling to come up with concrete policies or proposals to fill out ideas tossed out by the president. And it's an idea that mental health professionals say reflects outdated thinking on the treatment of mental illness.

Mr. Trump sometimes harks back to his earlier years in New York to explain his thinking on preventing future mass shootings. He recently recalled to reporters how mentally ill people ended up on the streets and in jails in New York after the state closed large psychiatric hospitals in the 1960s and 1970s.

"Even as a young guy, I said, 'How does that work? That's not a good thing,'" Mr. Trump said.

As the White House looks for ways to fight gun violence, officials have looked at Indiana as one potential model in addressing mental illness.

The state opened a new 159-bed psychiatric hospital in March, Indiana's first in more than 50 years. The hospital is focused on treating patients with the most challenging psychiatric illnesses and then moving them into treatment settings within the community or state mental health system.

Plans for the hospital were announced when Vice President Mike Pence was the state's governor.

"Our prisons have become the state's largest mental health provider," Pence said in 2015. "Today, that begins to change."

But Mr. Trump's support for new "mental institutions" is drawing pushback from many in the mental health profession who say that approach would do little to reduce mass shootings in the United States and incorrectly associates mental illness with violence.

Paul Gionfriddo, president and chief executive of the advocacy group Mental Health America, said Mr. Trump is pursuing a 19th century solution to a 21st century problem.

"Anybody with any sense of history understands they were a complete failure. They were money down the drain," said Gionfriddo.

The number of state hospital beds that serve the nation's most seriously ill patients has fallen from more than 550,000 in the 1950s to fewer than 38,000 in the first half of 2016, according to a survey from the Treatment Advocacy Center, which seeks policies to overcome barriers to treatment.

John Snook, the group's executive director, said Trump's language "hasn't been helpful to the broader conversation." But he said the president has hit on an important problem — a shortage of beds for the serious mentally ill.

"There are headlines every day in almost every newspaper talking about the consequences of not having enough hospital beds, huge numbers of people in jails, homelessness and ridiculously high treatment costs because we're trying to help people in crisis care," Snook said.

While Snook is not advocating a return to the 1950s, when there were 337 state hospital beds per 100,000 people in the U.S., he says states went too far in reducing facilities. He said the 2016 level of 11.7 beds per 100,000 people is inadequate.

Gionfriddo agreed more resources for the mentally ill are needed, but said any beds added should go to local, general hospitals, where patients would receive care for a full range of physical and mental illnesses.

That will require more federal money and loosening Medicaid's restrictions on mental health funding, he said. The first part is highly unlikely in the current fiscal environment, with the federal government expected to run a $1 trillion deficit in the next fiscal year.

But the administration has taken steps on the second part of the equation. A longstanding federal law has barred Medicaid from paying for mental health treatment in facilities with more than 16 beds to prevent "warehousing" of the mentally ill at the expense of federal taxpayers.

The administration in recent months said it will allow states to seek waivers from that restriction, provided they can satisfy certain requirements. Such waivers often take years to wind their way through the regulatory process.

The National Association of State Mental Health Program Directors has a different suggestion. After the El Paso and Dayton shootings, it recommended that Congress add $35 million for a block grant program to help states provide more community-based care to people in a mental health crisis.

When he ran for president, Mr. Trump issued a position paper on his gun positions that was more in line with what many mental health experts say: "We need to expand treatment programs, because most people with mental health problems aren't violent, they just need help," the paper said. "But for those who are violent, a danger to themselves or others, we need to get them off the street before they can terrorize our communities."

Marvin Swartz, a professor in psychiatry at Duke University, said research has shown that even if society were to cure serious mental illness, total violence would decline by only about 4 percent. He said he's seen no evidence that more psychiatric beds would reduce mass homicides or individual homicides.

"It would be a good thing to have more treatment resources, but the effect on gun violence would be minuscule," Swartz said.