The Styrofoam container, that staple of coffee shops and carry-outs, could be an endangered species in the District.

A ban on food and beverage containers made of plastic foam is among the provisions contained in a package of environmental legislation that Mayor Vincent C. Gray has submitted to the D.C. Council.

If the proposal is approved, the District would join Seattle, San Francisco, Portland, Ore., and dozens of other mostly West Coast cities that have banned foam containers on ecological grounds.

Polystyrene foam, of which Styrofoam is one brand, is not fully biodegradable and makes up a significant portion of the trash found in local waterways, officials said. Gray and his top environmental deputy said they want businesses to use compostable alternatives.

“This is part of the pollution challenge that we face with the Anacostia River,” Gray (D) said Wednesday at a news conference announcing the environmental initiatives. “One need only ride around on the banks of the Anacostia and the Potomac, and you will see the refuse in the river.”

The foam ban comes more than three years after the city imposed a 5-cent fee on plastic bags, a move that has generated about $2 million a year for river cleanup programs and is credited by environmental activists with keeping many stray bags out of the water.

“This is the next step to address the pollution problems that our rivers and waterways have here in the District of Columbia,” said Keith A. Anderson, director of the District’s Department of the Environment, who is working to comply with a goal set by Gray to make the Anacostia swimmable and fishable no later than 2032.

The plastics and hospitality industries have pushed back on foam bans in other jurisdictions — including recently in New York, where outgoing Mayor Michael R. Bloomberg (I) has pursued a ban. The American Chemistry Council released a study in March saying that a foam ban could nearly double packaging costs for food-and-drink retailers.

Warren Robinson, a spokesman for the council, said the proposed D.C. ban “would be an expensive new burden to businesses, restaurant owners and consumers who would be forced to use higher-cost alternatives.” Expanding the recycling of foam containers, he said, is the more sensible choice.

Robinson cited a 2011 study that estimated increased packaging costs of $8.5 million citywide should a particular type of foam, extruded polystyrene, be forbidden.

The local restaurant lobby is keeping an open mind on Gray’s proposal. Kathy E. Hollinger, leader of the Restaurant Association Metropolitan Washington, said many of her group’s members have already moved away from foam products.

City officials, Hollinger said, “are very much committed to working through some of the kinks so we can be on board to help them roll this out. . . . We are staying optimistic.” The association, she added, is working with local food-service vendors to determine how much foam alternatives will cost businesses.

The foam ban was among the initiatives floated by Gray last year when he unveiled his “Sustainable D.C.” plan. The enabling legislation sent to the council last month includes more esoteric measures, such as creating certification standards for radon-abatement contractors, partial tax rebates for car owners who switch from gasoline vehicles to alternative fuels, and new flexibility in rules for urban beekeepers.

But a ban on coffee cups and takeout containers stands to have, by far, the most impact on the average resident’s daily life.

“We knew that there would be some elements of it that would be controversial, and undoubtedly this will be one,” Gray said. “But if we really want to clean up the environment and keep it clean, we’re going to have to make these kinds of decisions.”

The foam ban was warmly greeted by Mike Bolinder of Anacostia Riverkeeper, who said plastic foam makes up a “substantial portion” of the trash his group removes from the river.

Intact foam containers are less of a problem, Bolinder said, than the smaller particles they disintegrate into over time. “It turns into little pieces that are indistinguishable from food for fish and animals in the river,” he said. “They’re impossible to clean up. We can pick up big pieces of paper and plastic, but those little pebbles of Styrofoam — unless you get out there with a shop vac, they’re kind of impossible to pick up.”

And, Bolinder said, as much of a problem as foam containers might be, their impact pales in comparison to plastic beverage containers. A “bottle bill” that would provide for a refundable deposit has long been considered a third-rail issue in city politics and is listed as a “long-term” goal in Gray’s sustainability plan.

“A bottle bill works in other states,” Bolinder said. “But the Styrofoam lobby is probably a lot less organized. They don’t have a Coke, a Pepsi or a Budweiser.”

Anderson said Wednesday that a bottle bill is being discussed. “Hopefully that’ll be something we may talk about in the near future,” he said.