A judge has ruled in favor of New York City in its battle with the restaurant industry over plastic foam containers, paving the way for the city to go forward with its ban on polystyrene containers.

In its ruling Friday in state court in Manhattan, the court said the single-use food containers cannot be recycled in a way "environmentally effective [or] economically feasible."

Judge Margaret Chan denied an appeal by a restaurant lobbying group and manufacturers. They argued that it was feasible to recycle the containers.

Mayor Bill de Blasio said the city will work to implement the ban immediately. A spokesman for the city law department said the ban will protect New York City's environment and its recycling program.

The Restaurant Action Alliance of New York City said it is disappointed with the court's decision, because many small business owners depend on the cost-effective foam.

Restaurant group lawyer Randy Mastro told Politico that his clients are reviewing their legal options.

New York City has been trying to ban plastic foam containers since 2013 under former Mayor Michael Bloomberg.