BANGOR, Maine — Bangor residents and visitors will have to be more careful about where they light up their next cigarette.

Bangor city councilors on Monday night approved a ban on smoking in city parks that includes playgrounds, swimming pools, ball fields and other amenities geared toward children. The move, which was approved 8-1, was intended to protect children and families from the effects of secondhand smoke and promote general public health, supporters said.

That vote followed a lengthy discussion during which Councilor Gibran Graham hoped to amend the proposed ban to include all the city’s parks, except Bangor Municipal Golf Course. A community member who brought the idea forward originally proposed an all-out ban in all city parks, which would have included about 40 areas across the city, but that proposal was scaled back during committee discussions to only include those frequented by children.

The effort to reinstate the total ban fell in a narrow 5-4 decision.

Councilor Ben Sprague, who voted against the total ban, argued that the council could always add parks and public spaces to the list included under the ban in the future.

“The personal liberty of someone who is smoking does not supersede the liberty of families and others who want to enjoy the outdoors to do so in a smoke-free environment,” Sprague said.

Councilor David Nealley opposed either ban, arguing they would be impossible for police to enforce.

“Pragmatically, it’s not really enforceable,” he said. “We’ve got higher priority things for the city’s police force to be working on.”

The ban includes cigarettes, cigars and pipes, as well as electronic smoking devices.

Tracy Willette, Bangor’s parks and recreation director, said signs would be installed at the parks included in the ordinance.

“City parks are a place to promote exercise and play, so we have to ask where smoking belongs in that space — it doesn’t,” Bangor resident Pete Hansen told the council. Other supporters at the meeting said they hoped the move would cut down on cigarette butt litter at these parks as well.

Councilors hinted there could be discussions in the future about whether the ban should be extended to other public spaces, such as West Market Square downtown.

Follow Nick McCrea on Twitter at @nmccrea213.