An environmental measure proposed by a Virginia Beach Republican would allow Virginia cities and counties to ban plastic shopping bags.

Bipartisan support for the bill signaled growing sensitivity in the Virginia Senate to environmental concerns. Introduced by Sen. Jeffrey L. McWaters (R-Virginia Beach), the measure passed out of the Senate on Monday on a 20-to-16 vote.

Sporting a plastic bag fashioned into a pocket square, McWaters said the legislation would give localities the option of passing such ordinances.

McWaters said plastic bags cause flooding when they clog drains and harm marine life when they enter waterways.

As a businessman, the former health-care chief executive said after the vote, “I want to attract people to a clean coastal community.”

To that end, he has introduced a similar bill banning adults from releasing non-biodegradable balloons into the air. Currently, a person can release up to 50 such balloons within a one-hour period. The $5 penalty paid for a violation would go to the state’s Virginia Litter Control and Recycling Fund.

Sen. Frank W. Wagner, a fellow Virginia Beach Republican, argued that the ban would hurt the commonwealth’s plastic-bag industry.

“Ten miles from where I stand right now . . . there’s a major factory that produces these plastic bags,” he said, and those jobs would be in danger if the bill passed.

McWaters emphasized that reusable bags, packages of garbage bags, and bags for meat, prescription drugs, alcoholic beverages and other specialty uses would be excluded.

After the bill failed narrowly on the floor, McWaters planned to reintroduce it later in the week so that two Democratic supporters absent for medical reasons could vote. But Sen. John S. Edwards (D-Roanoke) requested another vote Monday and switched from opposing to supporting the bill, later explaining that his initial no vote was a mistake. Fellow Democratic Sens. Kenneth C. Alexander (Norfolk) and Rosalyn R. Dance (Petersburg) also switched their votes.

Three other Republicans joined McWaters in supporting the bill: Senate Majority Leader Thomas K. Norment (James City) and Sens. John C. Watkins (Powhatan) and Jill Holtzman Vogel (Fauquier).

“Good luck in the House with that,” said Sen. Richard H. Stuart (R-Stafford) after the bill passed, a reference to the fact that McWaters’s bill will need to survive in the more conservative House of Delegates to become law.

More than 20 million people live in one of the 132 cities and counties that ban plastic bags, according to an April 2014 report from the Earth Policy Institute. Every county in Hawaii has banned the use of plastic bags; a statewide ban in California is facing a likely referendum. The Outer Banks of North Carolina, down the coast from Virginia’s Eastern Shore, banned plastic bags almost six years ago.

A related measure proposed by Sen. J. Chapman Petersen (D-Fairfax City), which would have imposed a 5-cent bag tax only in the Chesapeake Bay watershed, failed last month in the Senate Finance Committee.

“I’m not a tax guy,” said McWaters, adding that he thought a ban would be more effective. In the District, tax collection has remained steady ever since a 5-cent bag fee was imposed in 2010, suggesting that use has not declined. At the same time, studies have found that plastic-bag taxes, which have failed for years in the Virginia legislature, do reduce bag use.

“I think it gives more flexibility to retailers” to have a fee, said Petersen, because they can choose whether to pass the cost on to consumers. But he was a co-sponsor of McWaters’s bill, and he encouraged Democrats to support it in a caucus meeting.