San Francisco’s elected board of supervisors on Tuesday agreed to ban the use of natural gas in new buildings beginning in 2021.

The supervisors had imposed a gas ban earlier this year in new and remodeled municipal buildings, following the lead of a growing list of cities in California. At least 15 other cities in the state were considering similar bans earlier this year.

The supervisors said natural gas was the second largest source of greenhouse gas emissions in the city and San Francisco County, and the emissions are adversely affecting public health.

The ordinance was prefaced with the contention that it’s a major step by the local government to protect the global environment and lower health and safety risks. It said “natural gas infrastructure may rupture, fail...