Ford Motor Company scrapped plans on Tuesday to open a $1.6 billion factory in Mexico. Instead, the automaker said it will invest $700 million to expand a plant in Flat Rock, Michigan, adding 700 new jobs.

The company plans to build a new stable of electric vehicles and self-driving cars at the factory, including a hybrid-electric Mustang and F-150 pickup truck. The plant will also roll out new technology, such as a station that wirelessly charges electric vehicles.

While on the campaign trail last year, President-elect Donald Trump attacked Ford’s plans to move production of its Focus vehicle line to Mexico. He later falsely claimed he’d convinced the company to keep a plant open in Kentucky. In fact, Ford had never planned to close the plant.

The company said that Trump was likewise not responsible for its latest decision.

“We didn’t cut a deal with Trump. We did it for our business,” Ford CEO Mark Fields told CNN on Tuesday.

Still, Fields praised the incoming administration at a press conference on Tuesday morning.

“We’re encouraged by the pro-growth policies President-elect Trump and the new Congress have indicated they’ll pursue,” Fields said. “We believe these tax and regulatory reforms are critically important to boost U.S. competitiveness.”

Like many automakers, Ford has over the last two decades moved some production of small vehicles to Mexico, where labor costs are cheaper. In most cases, though, U.S. jobs remained at Ford.

When the company moved production of the Ford Focus to Mexico, workers who’d previously assembled the small car switched to making more popular SUVs and pickup trucks.

Google Finance Ford's stock jumped more than 3 percent after the announcement.

“To cancel a plant in Mexico is huge,” Jeremy Acevedo, analyst at the auto site Edmunds, told The Huffington Post. “There’s no industry quite as embroiled with unions and driving down labor costs as the auto industry.”

Ford’s plan to add more jobs in Michigan has strong union support.

“This is equivalent to a new assembly plant,” Jimmy Settles, vice president of the United Automobile Workers union, said during the press conference. “We fought very, very hard to make certain we could make a commitment early on for them to put this autonomous vehicle in the United States.”

“Too many times in the past we have produced quality vehicles and we have seen our jobs go overseas,” he added.

The announcement came hours after Trump criticized General Motors, another Detroit auto giant, for assembling some Chevrolet Cruze hatchbacks sold in the U.S. at a plant in Mexico.

The biggest threat to jobs, however, may not be outsourcing, but automation. Advances in robotics and artificial intelligence, coupled with 3D-printing technology, are likely to eliminate a great many jobs in the manufacturing industry over the next decade. Last year, billionaire Elon Musk showed off an array of robots already working in his Tesla Gigafactory, the $5 billion manufacturing facility where Musk plans to build electric cars and lithium-ion batteries.

In November, Trump struck a deal with the air conditioning giant Carrier to keep about 850 factory jobs in Indiana, in exchange for tax incentives and, potentially, lucrative federal contracts for Carrier’s parent company, United Technology Corp. Days later, United Technology CEO Greg Hayes said the company planned to invest $16 million at the Indiana factory “to automate to drive the cost down so that we can continue to be competitive.”

“Now, is it as cheap as moving to Mexico with lower-cost labor? No,” Hayes said during an appearance on CNBC’s “Mad Money.” “But we will make that plant competitive just because we’ll make the capital investments there.”

Arthur Delaney contributed to this report.