The Montgomery County Council unanimously voted Tuesday to block current plans to build a large gas station next to a Costco under construction by the Wheaton mall.

Civic activists had opposed the station, saying it would be a public health risk to residents and a nearby swimming pool. Costco says it must now find a new place for the pumps.

“Our application does not comply with what they approved,” Jeff Ishida, Costco’s vice president of real estate development, said in an interview. “We’re going to look at it, and see if it still works.”

Costco wanted to build the gas station on a vacant parcel southwest of the store, which is said to be a key part of the county’s effort to revitalize Wheaton. The retailer has been undergoing a rigorous application process to seek approval for the facility. But it must reapply — assuming it can find a new location.

In April, council member Marc Elrich (D-At Large) proposed legislation to block the plans in response to the community concerns about the station, which was expected to serve 16 vehicles at once.

For months, the original bill, which would bar large gas stations from being built within 1,000 feet of schools or recreation facilities, seemed like it would easily pass. But after an extensive lobbying effort by Costco, the outcome appeared less certain coming into the council meeting on the bill Tuesday.

Council members who initially opposed the restrictions — Council President Roger Berliner (D-Potomac-Bethesda), Nancy Floreen (D-At Large) and George L. Leventhal (D-At Large) — said they wanted the issue to move on to a panel of land use officials who would then decide. One co-sponsor, Craig Rice (D-Upcounty), had said he was reconsidering his support for the legislation because he didn’t know whether the 1,000-foot limit made sense.

But on Tuesday, Elrich proposed an eleventh-hour amendment that essentially changed the buffer from 1,000 feet to 300 feet. That change to the proposal drew unanimous support from the council while still prohibiting the large station Costco had wanted.

The bill allows Costco to move the gas station farther from the swimming pool or to build a smaller gas station. But Ishida said a smaller facility would be “unworkable.” He added that store construction is still on schedule. The branch is expected to open this fall.

Elrich said during the meeting that he would’ve preferred the 1,000-foot limit, “but getting four votes for 1,000 feet doesn’t a [law] make.”