A New York state appeals court on Tuesday revived two lawsuits accusing Hess Corp and Castle Oil Corp of cheating building owners by selling adulterated heating oil.

The Appellate Division in Manhattan ruled unanimously that a lower court judge erred in dismissing claims that the defendants from 2009 to 2013 blended "waste oil" into the higher-gradeheating oil that residential and commercial building owners in and around New York City had contracted to buy.

The plaintiffs, who sought class action status on behalf of thousands of building owners in New York City, Westchester County and Long Island, said the blending caused their heating systems to be less efficient, requiring some to buy more oil.

RELATED: New York City announces new safety measures for homeless shelters

Justice David Saxe rejected defense arguments that public policy might encourage the use of adulterated oil as fuel, and that the owners waited too long to pursue some of their claims.

He said the plaintiffs can pursue damages claims for breach of contract and breach of warranty "since we must infer from the complaint that plaintiffs received nonconforming oil deliveries of lesser value than those they contracted and paid for."

Tuesday's 4-0 decision reversed the September 2014 dismissals of both lawsuits by state Supreme Court Justice Shirley Werner Kornreich in Manhattan. Sprague Resources LP bought Castle assets in December 2014.

A lawyer for Castle declined to comment. Hess and its law firm did not immediately respond to requests for comment. Lawyers for the plaintiffs did not immediately respond to similar requests.

According to the appeals court, the lawsuits arose from an investigation begun in 2011 by the law firm Wachtel Missry, and which later involved federal and state authorities.

In November, Manhattan District Attorney Cyrus Vance Jr. announced criminal charges against nine other companies and 44 individuals for allegedly shorting customers on heating oil deliveries while charging full price over a nine-year period.

The cases are BMW Group LLC v Castle Oil Corp, New York State Supreme Court, Appellate Division, 1st Department, No. 16138; and Mid Island LP v Hess Corp in the same court, No. 16139.