The days when urban life in California involved regular inhalations of diesel smoke from rumbling buses will soon be history after the California Air Resources Board ordered transit agencies to make their fleets entirely emission-free within two decades.

The ruling, handed down by a unanimous vote Friday, is the latest move by California to seize control of its own greenhouse gas emissions as the Trump administration pushes for lower fuel efficiency standards and promotes the oil and gas industries.

The new rules prohibit the purchase of any new gas- or diesel-powered public transit buses by 2029 and require all buses to be emission-free by 2040. It is the first policy in the country to require electrification of a state’s entire public transit fleet.

“This is a huge deal,” said Adrian Martinez, an attorney for the conservation group EarthJustice. He said he expects airport shuttles, delivery and garbage trucks to be next on the regulatory list.

“It’s the type of strategy we need to tackle our air pollution and climate pollution problems, and there will be a lot more rules coming,” Martinez said.

The move, which conservationists hope will serve as an example for the rest of the country, will take an estimated 14,000 gas-guzzling public buses off the streets as they get old. Transit agencies will have to replace them with battery and fuel-cell electric vehicles.

The gradual phasing in of

zero-emission buses is designed to give the agencies and electric vehicle manufacturers time to design, build and purchase clean-fuel rigs, according to the Air Resources Board. Buses generally last about 12 years before they need to be replaced.

Heavy-duty buses and trucks make up 7 percent of the vehicles on California’s roads but contribute 20 percent of the heat-trapping carbon emissions spewed into the atmosphere, according to the Union of Concerned Scientists, a nonprofit science advocacy organization. The organization’s experts say heavy-duty vehicles are also the state’s largest source of nitrogen oxides, a major ingredient in particulate matter, or smog.

Currently about 150 self-propelled zero-emission buses are operated by transit agencies in California, officials said. The new standard is expected to reduce carbon emissions in California by 1 million metric tons by 2040.

But the state’s rules are being threatened by President Trump, who has pushed for revocation of California’s federal waiver that allows it to set more demanding tailpipe emissions standards.

Legislators and the Air Resources Board have fought back, laying out a series of ambitious goals to reduce car exhaust, including Friday’s bus standards. The board recently told automakers they must comply with the state’s mileage standards no matter what the federal government does.

The state’s goal is to cut carbon emissions to 1990 levels by 2020, but experts say the largest portion will result from greenhouse gas reductions by large utilities. Gov. Jerry Brown recently signed legislation requiring all of its electricity to be from clean sources, like solar, wind and hydro power, by 2045.

The San Francisco Municipal Transportation Agency recently committed to operating an all-electric transit fleet by 2035.

“The benefits of this decision go beyond addressing climate change and reducing air pollutants,” said Jimmy O’Dea, a senior vehicles analyst for the Union of Concerned Scientists. The move “sends a strong market signal to manufacturers around the world. California must keep leading the way on reducing transportation-related carbon emissions that contribute to global warming, because every fraction of a degree of warming we avoid matters.”

The 2015 Paris Climate Accord calls for limiting greenhouse gases enough to prevent a global temperature rise of more than 2 degrees Celsius, or 3.6 degrees Fahrenheit, by the end of the century. That’s the point at which catastrophic and irreversible problems would occur. Temperatures have risen about 1.4 degrees since the Industrial Revolution.

In addition to the environmental benefit, California regulators and conservation groups believe the limits imposed by the state on greenhouse gas emissions will be good for business.

“The current demand for clean buses has made California a hub for electric bus manufacturing,” said Kathryn Phillips, director of Sierra Club California. “We have six factories or assembly facilities located here. This rule will create even more good-paying jobs across the state.

“The future of public transit consists of a quieter ride, cleaner air and a healthier economy.”

Peter Fimrite is a San Francisco Chronicle staff writer. Email: pfimrite@sfchronicle.com. Twitter: @pfimrite