The Montgomery County Council on Tuesday will vote on a bill that would block plans for a gas station at the Costco under construction next to the Wheaton mall.

For months, the bill seemed like it would easily pass. But now, after an extensive lobbying effort by the retailer, the outcome appears uncertain. And the county’s attorney has said the legislation is unconstitutional.

For more than two years, civic activists have fought Costco’s plans, saying the gas station would create a public health risk to nearby residents and a swimming pool less than 1,000 feet away.

Costco has said the gas station is an integral part of its new store, which is seen as a key part of the county’s effort to stimulate economic development in Wheaton.

In April, responding to the community’s concerns, County Council member Marc Elrich (D-At Large) proposed the bill that would bar large gas stations from being built within 1,000 feet of schools or recreational facilities. If the legislation passes, Costco could build a smaller gas station on the site or move it to a vacant car dealership nearby.

Initially, five members — a majority — of the County Council expressed support for the bill. Since then, Costco has sent lobbyists to Rockville to meet with council members and defeat the bill. The company has submitted an environmental study that suggests the gas station’s public health effect on the community is minimal.

Now one co-sponsor, Council member Craig Rice (D-Upcounty), says he’s reconsidering his support.

Rice said he’s not sure that the 1,000-feet benchmark makes sense. He said the scientists provided by Costco and the Kensington activists have not been able to say with “scientific certainty” what the right distance would be, so he thinks council members need more time to consider the matter.

“I’m really on the fence,” he said in a recent interview. “I don’t know what would be right for us.”

Council member Phil Andrews (D-Gaithersburg-Rockville) has also said that he is not sure how he will vote.

In a statement, Erich Brann, Costco’s director of real estate development, said the bill represents “public policy gone awry.”

County Executive Isiah Leggett (D) has criticized the bill, and the county’s top land-use attorney said last week that the bill is unconstitutional. Leggett also successfully lobbied the County Council to approve a $4 million subsidy to Westfield, the developer of the Wheaton site, to help secure the Costco deal.

Business leaders have testified against the bill, saying it is overly burdensome. Meanwhile, a majority of county planning board members have said the Costco gas station should be held harmless.

Howard Nussbaum, president of the Kensington Heights Civic Association, said in an interview Monday that he was disconcerted by Rice’s change of heart. Nussbaum said he hopes that council members keep the community’s interests at heart.

“We’re not asking to ban these gas stations. We’re not even saying don’t put it in the mall. We’re saying . . . they’ve got to move it a little bit,” he said. “It seem reasonable to me.”