The long-term solution to New York City's increasingly visible homeless population is to provide mental health care, not just put them behind bars, Police Commissioner William Bratton said Sunday.

"You can't arrest your way out of this problem," Bratton said in a WNYM/970 AM radio interview, while acknowledging the erratic behavior of some homeless people is enough to "scare the hell out of everybody."

The city's top cop told host John Catsimatidis that 5,000 to 10,000 NYPD officers are being trained to better deal with emotionally disturbed individuals.

But resolving the homelessness issue will take a multipronged approach, with the city's Health and Hospitals Corporation and Department of Homeless Services pitching in, Bratton said on "The Cat's Roundtable."

January 2014 figures showed the number of homeless people sleeping each night in the New York City shelter system increased by 7 percent, from 50,135 people in January 2013 to 53,615 people, the highest level ever recorded, according to the Coalition for the Homeless.

The city's first lady, Chirlane McCray, on Friday announced a $30 million public-private partnership called Connections to Care to integrate mental health services into existing programs that serve lower-income communities.

Mayor Bill de Blasio told reporters Wednesday he doesn't "love" that there are so many people living on the streets but they are permitted to do so unless they're breaking the law.

advertisement | advertise on newsday

"There are certain rules under our Constitution where people can be out on the street," he said.

"But the minute someone is aggressive, the minute someone is threatening, the minute someone is violent, or the minute they break a law, we're going to address that very aggressively."

De Blasio said he supports police enforcement of quality-of-life crimes -- from public urination to trespassing -- as part of Bratton's "broken windows" crime-fighting approach.

The city is reworking its entire mental health system to aid in the fight against homelessness, he said. "Our street homeless population is largely people who have mental health challenges," the mayor said, "and we need to approach that different than we have in the past."

Bratton said that every city has been experiencing a hike in homelessness, including Los Angeles, where he formerly served as police commissioner and which he visited recently. Los Angeles has seen an "explosion" in homeless individuals, including those who set up tents on the streets, he said.