General Motors has pledged to stop making gasoline-powered passenger cars, vans and sport utility vehicles by 2035, marking a historic turning point for the iconic American carmaker and promising a future of new electric vehicles for American motorists.

GM chief executive Mary Barra, who antagonized many climate experts by embracing President Donald Trump’s relaxation of fuel efficiency targets, said Thursday the company now wants to lead the way to a greener future.

“As one of the world’s largest automakers, we hope to set an example of responsible leadership in a world that is faced with climate change,” Barra said on LinkedIn.

GM has said it would invest $27 billion in electric vehicles and associated products between 2020 and 2025, outstripping its spending on conventional gasoline and diesel vehicles.

That figure includes refurbishing factories and investing in battery production in conjunction with LG Chem, a South Korean battery maker.

As part of its plan, GM — maker of Buicks, Cadillacs, Chevrolets and Corvettes, among others — will manufacture about 30 types of electric vehicles.

By late 2025, about 40 percent of the company’s U.S. models will be battery-powered electric vehicles, it said. And it pledged to make its factories and other facilities carbon neutral by 2040.

One of the Big Three automakers that dominated the North American car market for decades, GM has rolled out millions of pollution-spewing cars and trucks.

Transportation accounts for about 28 percent of total U.S. greenhouse-gas emissions, making it the largest contributor of the pollution that is driving climate change.

GM now faces the task of reorienting and revamping supply chains, assembly lines and its labor force to produce a new kind of product that few Americans have experienced.

“This is a very significant pivot … especially for such an iconic American institution,” said Barry Rabe, a professor of public policy at the University of Michigan.

For a century, GM has been a giant of American carmaking and of the Michigan economy.

In Rabe’s corner of southeastern Michigan, where tens of thousands of people are employed by the auto industry, “the central part of life has been the performance of the internal-combustion engine.”

“This is more than just a quick flip of the dial,” he said. “It’s a very wrenching transition.”

It will also be expensive, said Kristin Dziczek, vice president of industry, labor and economics at the nonprofit Center for Automotive Research.

Converting an assembly plant to produce electric cars is a billion dollar or more investment, she said. And pledging to complete that transition by 2035 is “an aggressive target,” she said.

The electric-vehicle industry has grown exponentially in the past decade but still represents less than 2 percent of automobiles sold in the United States.

Global electric-vehicle sales grew in 2020 even while the rest of the car market suffered from the economic fallout of the coronavirus pandemic.

The International Energy Agency projects that the global number of battery-powered and hybrid vehicles could increase from just over 5 million to nearly 140 million by 2030.

The timing of the GM announcement was tied in large part to the election of Joe Biden to the White House.

On Wednesday, President Biden detailed a far-reaching plan to transition the U.S. economy away from oil, gas and coal and toward solar, wind and other clean energy.

The president said he wants the country to lead the global effort to cut the pollution that is driving climate change and speeding the planet toward environmental catastrophe.

As part of several actions, Biden signed an executive order that calls for the federal fleet of approximately 645,000 vehicles to be converted to electric power.

He has also vowed to expand charging stations for electric cars, revise and extend electric-vehicle tax credits and tighten fuel economy standards for gas-powered vehicles.

“On the heels of the President’s historic actions yesterday, we applaud efforts by the private sector to further embrace renewable and clean energy technologies,” Vedant R. Patel, a White House spokesman, said in an email. “As the President and many others have said, efforts like this will help grow our economy and create good-paying union jobs.”

Other government action has also pushed the auto industry toward electrification. California, the world’s fifth-largest economy and the state that created U.S. car culture, will stop sales of gasoline-powered automobiles within 15 years, Gov. Gavin Newsom (D) announced in September.

The United Kingdom plans to stop the sales of cars and vans powered by gas and diesel by 2030, five years earlier than planned.

“Major industries have to kind of look to the future and anticipate it,” Rabe said. “Do you really want to be the last one standing with the possibility that you’re just producing nostalgic vehicles that are being regulated or priced out of existence?”

GM’s announcement was seen by others in the automobile industry as a public relations effort to outflank rivals, many of which have already launched aggressive electric-vehicle programs.

Volkswagen, for example, is planning to launch almost 70 new electric models in the next 10 years, increase its electric-vehicle production over the next decade to 22 million and pour about $33 billion into electrifying its other vehicles.

Ford, which has been building vehicles with internal-combustion engines for more than a century, is spending $11.5 billion through 2022 on new EVs. Tesla plans to increase sales of its all-electric fleet.

GM’s stock rose nearly 3.5 percent Thursday.

The move toward ending tailpipe emissions will affect GM’s passenger cars and light-duty trucks — SUVs such as the Yukon, as well as vans and minivans and some pickup trucks, such as the Silverado, a company spokeswoman said.

But its heavy-duty vehicles — box trucks, tractor trailers, utility trucks and some heavy pickup trucks — will continue to run on gasoline, the company said.

GM also said it is working with EVgo to triple the scale of the nation’s largest public fast-charging network by adding more than 2,700 fast chargers by the end of 2025, a move it says will help speed up electric-vehicle adoption.

The chargers will be powered by 100 percent renewable energy.

Fred Krupp, president of the Environmental Defense Fund, which had worked with GM on its plan, called it a “breakthrough moment.”

“And it’s part of a wave of industry action that reinforces what the Biden administration is doing,” Krupp said.

Biden’s plan to electrify the federal fleet, from postal trucks to government vans, “creates demand and drives down costs as privately owned fleets follow suit,” Krupp said.

Some critics said that GM still had not publicly joined four other automakers — Ford, Honda, VW and BMW — that agreed to comply with California’s fuel efficiency standards, which are more stringent than the federal targets under Trump.

The California settlement is an important benchmark in restarting negotiations among auto companies, the California Air Resources Board and the Biden administration over cutting greenhouse-gas emissions in the transport sector.

For now, GM has still not made as big a commitment as the others through 2026, when fuel economy gets renegotiated again.

Lawmakers, however, applauded GM’s move.

“General Motors committing to exclusively sell zero-emissions vehicles by 2035 and to be carbon neutral by 2040 is a big deal,” Sen. Sheldon Whitehouse (D-R.I.) said in a statement. “This is good news for our climate and a smart financial move for the company — a win-win.”

By pledging to go carbon neutral by 2040, “GM demonstrates that members of the auto industry are committed to tackling the global climate crisis and decarbonizing the transportation sector,” Rep. Debbie Dingell (D-Mich.), who is a former GM executive and also served as president of the General Motors Foundation, said in a statement.

“We have had discussions for months with the auto industry, labor unions, and the environmental community on concrete actions like this that must be taken to reach carbon neutrality.”

GM’s announcement showed that “industry does want to work with the administration” and that “industry realizes that climate change is real and action on the part of industry is needed,” Dingell said in an interview.

In her statement, she added, “Even as we celebrate this announcement, we need to keep our focus on creating jobs, confronting climate change, and the transformation of an innovative mobility industry.”

Paul Bledsoe, a former climate adviser in the Clinton White House, said GM is setting the tone for U.S. manufacturing. “When America’s most iconic manufacturer commits to carbon neutrality, that’s a huge signal to the rest of the economy,” said Bledsoe, who is now at the Progressive Policy Institute.

“At the same time, it’s clear GM is trying to burnish its reputation from past practices and justify new tax incentives.”

And now, GM will have to persuade American consumers to change a century-old habit.

“It will be incumbent on these auto manufacturers to really sell the transition,” Rabe said, “not just with glitzy advertising and sales pitches but delivering on quality of the driving and of the experience.”