FLINT, Mich. — General Motors plans to invest nearly $1 billion in four U.S. plants to support production of components for electric vehicles as well as the next generation of V-8 engines, signaling that gas-powered trucks and high-performance cars are here for the foreseeable future.

The $918 million investment that GM announced Friday comes despite the automaker’s plans to offer all-electric consumer vehicles by 2035. This is the latest example of legacy automakers like GM needing to balance their current vehicle lineup with upcoming EVs.

“Our commitment is undoubtedly to an all-electric future,” Gerald Johnson, global head of GM manufacturing, told reporters after the announcement. “We know that has a horizon, and between here and there there are many combustion engine customers that we don’t want to lose.”

A majority of the investment — $579 million — will go towards preparing GM’s Flint Engine Operations plant in Michigan for the automaker’s sixth-generation family of small-block V8 gas engines.

The engines are used in some of the automaker’s most profitable products, such as its large pickup trucks and SUVs. They were also used in some high performance Cadillac and Chevrolet cars.

GM said work at the Flint plant will begin immediately, signaling that next-generation V-8 engines are on the horizon. The automaker declined to elaborate on the engines’ timing, performance and other details. The last new family of V-8 engines appeared in 2013.

The remaining investments, according to GM, will be in other parts operations in Michigan, Ohio and New York for gas-powered parts like camshafts and manifolds, and castings to support future electric vehicles.

Like the company, executives at the United Auto Workers union stressed the need for investment in both traditional operations and electric vehicles.

“Will the electric drive come tomorrow? Is it still 10 years away? They still need the internal combustion engine until the technology for electric vehicles is perfected,” newly elected UAW Vice President Mike Booth told CNBC.

UAW President Ray Curry, who is in a runoff to retain his post, said the union welcomes investment in both areas as the industry and its workers change.

“We want the ability to ensure that existing operations are sustained and that new operations that come online have the capital investment to move forward,” he said.

The union, set to negotiate with GM later this year, wants emerging EV jobs to be ranked the same as their traditional engine and powertrain jobs. In contrast, the company has expressed the need to do much of the work in a lower wage bracket in order to be competitive.

Booth, who heads the UAW’s GM unit, called Friday’s investment a “big deal,” but said it had no bearing on upcoming negotiations.