The Texas city of Austin implemented a new ordinance this week preventing restaurants from disposing of food waste in landfills.

Restaurants may donate unconsumed food, send scraps to farms or compost it under the law that took effect Oct. 1. The measure also stipulates that employees receive training about handling the waste.

“The City is committed to helping companies, large and small, find cost-effective solutions and establish diversion programs to ensure food and other organics are put to best use while meeting ordinance requirements,” Sam Angoori, interim director of Austin Resource Recovery, an organization helping businesses sustainably transform food waste, said Monday in a statement.

Austin, the Texas state capital, decided to focus on restaurants after a 2015 study determined that more than 85 percent of trash and recycling came from commercial businesses, multifamily properties and the food service industry. The study showed 37 percent of what ended up in landfills is organic waste that is compostable.

The new law bolsters the city’s goal of zero waste by 2040. In addition to encouraging food donation and composting, the plan calls for expanded recycling and economic development.

Nationwide, 40 percent of food goes to waste, yet tens of millions of people are food-insecure, according to the Natural Resources Defense Council.

“When we waste food, we not only add organic materials to landfills (where they generate methane, a powerful global warming pollutant), but we also waste all the water, land, energy, money, labor, and other resources that go into growing, processing, distributing and storing that food,” said Darby Hoover, senior resource specialist at an NRDC program focused on food waste.

A handful of cities have enacted similar initiatives. San Francisco, considered the leader of the pack on food waste reduction, diverts about 80 percent of its total waste from landfills. In Seattle, all residents, buildings and food businesses are required to sign up for a food waste collection service. Large restaurants and food retailers in New York City are required to responsibly dispose of their extra food as well.

Clarification: A previous headline indicated the ordinance was a ban when in fact it requires businesses with food permits to create a food diversion plan.