FedEx Corp must face a second lawsuit claiming it shipped thousands of cartons of untaxed cigarettes in New York over roughly a decade, cheating the state and New York City out of tax revenue and undercutting their efforts to curb smoking.

In a decision made public on Friday, U.S. District Judge Edgardo Ramos in Manhattan rejected FedEx's bid to dismiss claims by New York State and New York City that it violated a federal anti-racketeering law and the Contraband Cigarette Trafficking Act.

Ramos said FedEx must also face claims it violated its 2006 agreement with the state, later extended nationwide, not to do business with sellers that ship cigarettes to people's homes. He dismissed two other claims related to a state public health law.

RELATED: Court upholds New York outdoor smoking ban 

The judge rejected FedEx's argument that its alleged dealings with shippers such as "Your Kentucky Tobacco Resource," "Cigarettes for Less" and "Smokin' Joes" was too far removed from the resulting financial harm.

FedEx's alleged involvement "was precisely the conduct that led to the plaintiffs' losing tax revenue," he wrote. "The alleged scheme's entire purpose was to evade the City and State's cigarette taxing regime."

A spokesman for FedEx had no immediate comment. The office of state Attorney General Eric Schneiderman did not immediately respond to a request for comment. Eric Proshansky, a lawyer for the city, said he was pleased with the decision.

The lawsuit covers Memphis, Tennessee-based FedEx's dealings with 21 shippers, including some associated with Native American tribes such as Shinnecock Indian Nation.

It is separate from a lawsuit by the state and city over FedEx's dealings with four other shippers.

Ramos refused to dismiss that lawsuit in March 2015, and in a separate ruling on Friday narrowed FedEx's defenses to some claims it raised.

RELATED: NY state raises minimum wage to $15 

Both lawsuits accuse FedEx of costing the state between $15 and $43.50 per carton, and the city $15 per carton, in excise taxes through illegal cigarette shipments.

A carton usually contains 10 packs.

The state and city have also sued FedEx rival United Parcel Service Inc over cigarette shipments. In September, U.S. District Judge Katherine Forrest in Manhattan rejected UPS' bid to dismiss that lawsuit.