Twenty-four men, several with reputed links to some New York Mafia families, were charged with running numerous schemes, including the diversion of marijuana legally grown in California and clandestinely sold in the city and on Long Island, officials said late Tuesday.

The two-year probe, run by the NYPD, the Waterfront Commission and the Manhattan District Attorney’s office, led to arrests for oxycodone distribution, gambling and tax fraud, in addition to the marijuana smuggling, according to a statement issued Tuesday by the law enforcement agencies.

Police estimated the suspects pulled in close to $20 million in profits over 24 months from the various schemes, an NYPD official said.

Among those charged are Michael Paradiso, 74, of Staten Island, a reputed captain in the Gambino crime family, as well as reputed Gambino associate William Oliva, 55, of Brooklyn, said the official. Officials said they played a role in distributing the marijuana.

Also arrested were Richard Sinde, 51, of New Jersey, a reputed Bonanno crime family associate and Lawrence Dentico, 33, of California, whose grandfather is a Genovese crime family captain, police said.

In all, members or associates from four of the five Cosa Nostra families in New York City were involved in some aspects, which police called unique.

According to law enforcement officials, Sinde and John Kelly, 52, of Sacramento, California, were ringleaders of the marijuana operation that coordinated and shipped hundreds of pounds of the plant from legal growers in Northern California’s “emerald triangle.” The growers were able to legally harvest the marijuana for their own prescription use but overgrew the crop and diverted some to the ring, prosecutors charged. Barry Sussman, 56, of Rutherford, New Jersey, was also charged and allegedly allowed the ring to unpack the marijuana at his Long Island warehouse.

The marijuana was sold here under such brand names as “Pineapple Haze,” “Girl Scout Cookies” and “Blue Dreams,” NYPD Insp. John Denisopolous said.

Investigators seized more than 600 pounds of marijuana, 600 oxycodone pills and 11 handguns, Denisopolous said.

Arraignment information wasn’t available late Tuesday.