ALBANY — Gov. Cuomo signed a new law Thursday living the ban on the possession of “gravity knives” — or pocket knives.

The ban had been in place since 1958.

Cuomo vetoed similar measures in 2016 and 2017 because of objections from law enforcement, but a federal judge in March declared the ban unconstitutional, concluding it encourages “arbitrary and discriminatory enforcement.”

“While I am aware of the cautious community voices, I cannot veto a bill passed by the Legislature to address a decided constitutional infirmity in existing law, as recently affirmed by a federal court,” Cuomo explained his approval in a memo.

“Gravity knives” are folding knives commonly used in the skilled trades industry, by chefs or artists. They can be bought in hardware and sporting goods stores.

Before Cuomo’s action, possession of the knives could result in a Class a misdemeanor and those charged and convicted could end up with up to one year in prison.

Supporters argued 85 percent of arrests were black and Latino, unfairly targeting minority groups who work in the construction or maintenance industries.

Backers of legalizing the knives applauded the governor’s action.

“The third time really is the charm. After seven years, we have finally managed to overhaul New York’s outdated and discriminatory pocket knife ban,” said bill sponsor Assemblyman Dan Quart (D-Manhattan).

“No stage hand, no plumber, and no carpenter should have to risk their freedom to carry a tool they need for work. They will no longer have to. No more will unsuspecting and otherwise law abiding New Yorkers – most of them people of color – be swept up into the criminal justice system because of a broadly worded statute.”