Mayor Bill de Blasio said on Friday that he wants panhandling to be illegal in New York City — but lamented that begging has been found to be a constitutional right.

Speaking on his weekly radio appearance on WNYC, de Blasio said it’s “frustrating” and “off-putting” to see begging on the street, though “I know there’s no legal way to get rid of that.”

“Sometimes, we see people on the street who are bluntly just panhandlers, who are actually not even homeless . . . I wish that were illegal, it’s not illegal” de Blasio said, calling in from Germany, where he traveled Thursday to protest the excesses of capitalism at the G-20 summit of global leaders, including President Donald Trump.

Homelessness has skyrocketed under de Blasio, continuing a trend that began with his predecessors: an annual head count released earlier this week estimated a 40 percent spike in the number of people living on the street, to nearly 3,900 from about 2,800 last year.

De Blasio blamed the latest increase, in part, on nicer-than-usual weather the day of the count, but he conceded: “There’s no question there’s a problem there.”

The mayor hadn’t always agreed that homelessness is on the rise. Earlier in his administration, de Blasio shrugged off claims that homelessness is up as tabloid hyperbole.

advertisement | advertise on newsday

Courts have ruled that people have a constitutional right under the First Amendment to beg. Panhandling on public streets is legal, though it can be restricted in places like subways and parks.

De Blasio also defended his decision, announced late Thursday, to fly to Germany to protest the G-20. The sergeants’ union blasted his decision to go, with violent protests embroiling the summit. De Blasio’s presumptive GOP opponent, Assemblywoman Nicole Malliotakis, criticized de Blasio for leaving the city the day after an NYPD officer, Miosotis Familia, had been slain in the Bronx.

But de Blasio told radio hosts Brian Lehrer: “All the issues that need to be attended to, I am attending to every day, regardless of where I am and my team’s attending to.”