SACRAMENTO, Calif. — California will ban smoking on state parks and beaches starting next year under legislation signed by Gov. Gavin Newsom.

The law also bans disposing cigar and cigarette waste at parks and beaches. Violations of the law will be punishable by a fine of up to $25. Newsom, a Democrat, announced Friday he had signed the bill into law.

It covers smoking traditional cigarettes as well as using electric smoking devices. Smoking will still be allowed in parking lots at beaches and parks. Film and television productions can still allow people to smoke on state property with the proper permits.

Democratic state Sen. Steve Glazer has been pushing such a ban for years, with lawmakers approving it several times. But former Gov. Jerry Brown, a fellow Democrat, repeatedly vetoed it.

“We have many rules telling us what we can and can’t do and these are wide open spaces,” he wrote last year.

Glazer has argued such a rule will protect public health and curtail pollution.

California already prohibits smoking at child care centers, within 25 feet (7.6 meters) of farmers’ markets, in government buildings and on public transportation. Cities and counties can also adopt their own smoking laws.

California has roughly 280 state parks and 340 miles (547 kilometers) of coastline.

A legislative analysis predicts it will cost the state parks system nearly $2 million to put up more than 5,000 signs alerting people to the ban and complying with various state regulations.

The law is supported by many medical and environmental groups as well the cities of Huntington Beach and Santa Monica. Many Republicans in the Legislature voted against the measure.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.