The investment will create 4,000 jobs and significantly increase G.M.'s ability to build electric vehicles in the United States, the company said.

G.M. has battery plants under construction in Ohio and Tennessee and has refurbished a Detroit plant, where it recently began producing an electric Hummer truck. It also plans to produce electric vehicles at a plant in Ontario and another in Mexico. G.M.'s new battery plant in Michigan, like G.M.'s other battery plants, will be a joint venture between the automaker and LG Electric. It will be built on the site of an existing plant in Lansing at a cost of $2.6 billion to be split between G.M. and LG.

G.M. has said it aims to phase out gasoline vehicle production by 2035, but so far, Ford is ahead of G.M. in electric vehicle sales. Ford has been selling an electric S.U.V., the Mustang Mach E, for more than a year and has logged more than 200,000 reservations for the electric F-150 Lightning.

This investment plan from an automaker is the latest in the industry to accelerate electric vehicle production. In December, Toyota said it plans to build a battery factory in North Carolina that would employ 1,750 people.

Ford Motor has already overhauled a plant in Dearborn, Michigan, and is expected to begin producing an electric version of its F-150 pickup this spring. Ford also plans to spend $11.4 billion to build two battery plants in Kentucky and a third battery plant and electric truck plant in Tennessee.