(Bloomberg) -- General Motors Co. plans to spend $6.5 billion on an electric pickup plant and battery factory in Michigan thanks in part to a $1.8 billion incentive package put together by the state to make sure the automaker didn’t take a big piece of its EV business elsewhere.

The automaker’s investment and the subsidy package were disclosed Tuesday by state and local economic development authorities. There’s a race among states to woo automakers and technology companies for battery and EV plants, semiconductor manufacturing and other high-tech business expansion. Economic development staff in Michigan wanted to make sure the state remains a key location for the future of automaking as the industry shifts from fossil fuels to electricity.

GM plans to expand its existing assembly plant in Orion Township, outside Detroit, to convert the compact EV plant to make electric pickup trucks and assemble battery packs. The facility currently makes the Chevy Bolt EV and larger Bolt EUV plug-in. The automaker will build its third battery plant in the Lansing area.

The Lansing facility will be owned by Ultium LLC, the battery cell venture jointly owned by GM and its partner, Korea’s LG Energy Solution. In total, the new project will add 4,000 jobs as GM tools up to produce 30 EV models by 2025. The company has committed to invest $35 billion to do so.

To make sure GM picked its home state, the Michigan Economic Development Corp. gave the automaker a $600 million grant from state funds, $158 million in total tax breaks, $66 million in infrastructure grants and nearly $937 million in lower electric and water rates over 20 years.

Michigan officials were stung when GM announced a battery plant in Tennessee last year and Ford Motor Co. also picked the state and said it will build another in Kentucky.

Read more: Ford Gives Michigan ‘Wake-Up Call’ With Southern EV Expansion

GM’s plan is a victory for Michigan Governor Gretchen Whitmer, a Democrat, whose administration favors using financial incentives and tax breaks to lure development, especially green industries like electric vehicles. Her predecessor, Republican Rick Snyder, had preferred corporate tax cuts to targeted tax credits.

“The state and the region had everything to lose and everything to gain by doing this,” said Bob Trezise, chief executive officer of the Lansing Economic Area Partnership, which helped land GM’s future battery plant in the region. “For 10 years the state has not been successful at landing these top-of-the-pyramid projects.”

State officials believe the investment is well worth it, according to MEDC documents. GM’s plan will help the state become a key player in building the electric-vehicle supply chain and maintain vehicle assembly as gasoline-burning vehicles are phased out in coming decades. The MEDC also estimates that the project will generate $28.8 billion in personal income in the state over 20 years, the document said. 

GM was always likely to pick Orion to make some type of electric vehicles. The plant already build EVs. But its first electric-truck plant, the so-called factory Zero plant in Detroit, gets its battery cells from an Ultium factory in Ohio. The company could have supplied the Orion plant with battery cells from outside Michigan, but is choosing to make them in its home state instead, Trezise said. 

GM CEO Mary Barra once sided with Donald Trump’s push to strip California of its right to set its own emission standards, a move she made after being a frequent target of the former president because she cut jobs to save cash and invest in electric vehicles. 

Barra changed her stance on the issue and has embraced President Joe Biden’s push to redouble a federal sales-tax break of $7,500 for consumers buying a new EV.

©2022 Bloomberg L.P.