Should D.C. ban foam containers, it would join Seattle, San Francisco and dozens of other cities. (Sarah L. Voisin/The Washington Post)

District lawmakers quietly voted Tuesday to ban the use of plastic foam food and drink containers, still a common option in city cafes and carry-outs, by 2016 — putting D.C. in the company of Seattle, San Francisco and other cities that have banned foam containers for environmental reasons.

The foam ban was included in a broader environmental bill, introduced by Mayor Vincent C. Gray (D) last fall, that passed an initial vote Tuesday without debate.

Under the version of the Sustainable DC Omnibus Act of 2014 passed Tuesday, the ban would take effect Jan. 1, 2016 — two years sooner than Gray had sought. Further, food and beverage outlets would be required to offer only compostable or recyclable containers by 2018.

The bill passed over objections from the plastics industry, which has called the foam ban “an expensive new burden” on businesses and consumers. But the foam ban was championed by environmental activists, particularly those working in city waterways, who have said foam containers dissolve into tiny particles that can harm fish and animals.

Council member Mary M. Cheh (D-Ward 3), who chairs the committee that handled the bill, said consumers shouldn’t have to sacrifice much — holding up her paper Starbucks cup behind the council dais. “This is a great cup,” she said. “They won’t notice the difference, and they can feel better about themselves and the environment.”

The foam ban comes four 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.

Other parts of the bill provide for more transparency in utility billing, require employers of 20 workers or more to offer a transit benefit program, ease beekeeping regulations and tighten restrictions on tree removal.

A second and final vote on the bill could come as soon as July 14.