(Bloomberg) — Ford Motor Co. plans to spend about $900 million and hire about 900 workers to build electric and self-driving vehicles in Michigan, while moving production of a small commercial van to Mexico from Europe.

The moves, announced the same day Donald Trump visits an Ohio tank plant, follow the president’s sharp criticism of General Motors Co. for idling a car factory in Lordstown, Ohio. Ford is reiterating some previous financial and employment commitments while changing gears for the third time on building electric autos at an underutilized factory south of Detroit.

Roughly a year and a half after shifting production of a future electric sport utility vehicle to Mexico from Flat Rock, Mich., Ford says it now plans to build other battery-powered models there and add a second shift of workers by 2023, at a cost of $850 million. The automaker also is spending $50 million to establish a facility near Detroit where workers will add self-driving software to autonomous vehicles that will be built elsewhere. The Flat Rock factory will continue to produce the Mustang sports car and Lincoln Continental sedan.

“When we stepped back and looked at our plans for the future with battery-electric vehicles and electrification in general and the commitment to $11 billion in investment, it was very clear to us over the last year or so that we were going to need a second plant,” Joe Hinrichs, Ford’s president of global operations, said in an interview. “It became pretty clear to us that Flat Rock was the right plant to have that capacity. It has a lot of experience building multiple different things.”

Trump took note of Ford’s investment, tweeting his praise Wednesday shortly after his speech in Ohio.

“Great news from Ford!” Trump wrote. “They are investing nearly $1 billion in Flat Rock, Michigan, for auto production on top of a $1 billion investment last month in a facility outside of Chicago.”

As sales of traditional sedans have dwindled, Ford is preparing for a future when electric vehicles and self-driving cars transform transportation. The Flat Rock factory has become a symbol of that change: Ford is cutting a shift of workers because of slow sales of the Continental and Mustang, but will now create new jobs to build battery-powered vehicles.

The United Auto Workers union, which is entering contract negotiations with more than 150,000 workers at Ford, GM, and Fiat Chrysler Automobiles NV, praised the new investment.

“As we transition to new technology and future products, Flat Rock through this investment, is well positioned to be a world leader for decades to come in auto industry technology and production,” UAW vice president Rory Gamble said in a statement.

Chief executive officer Jim Hackett is leading an $11 billion overhaul of Ford, which saw net income fall by more than half last year. The restructuring will involve cutting thousands of salaried jobs and closing factories in unprofitable overseas operations.