GM will throw a bone to President Donald Trump, announcing Friday its investment into its electric car plant north of Detroit after enduring intense criticism over shuttering a plant in Ohio and laying off thousands of workers.

The automaker released a media advisory that says it, the United Auto Workers union and local government officials will make things official today at the factory in Orion Township, Michigan. GM will reportedly invest $300 million and create 400 new jobs at the Michigan plant.

GM has taken a lot of heat from Trump over the closure of its Lordstown plant in Ohio, a critical swing state that Trump won in 2016 that will likely be just as important for his reelection chances in 2020.

“Get that plant open,” Trump demanded this week, telling GM to either reopen it or sell it to someone else who will.

GM said in a statement earlier this week that it will not be swayed on reopening the Lordstown plant, where the Chevy Cruze was made. With gas prices holding relatively low, demand for small sedans like the Cruze has waned drastically.

Per Bloomberg:

GM-Trump

Building an all-new electric vehicle in Orion would underscore GM’s gradual shift away from gasoline-fueled cars toward battery-powered models. The investment announcement will come at a time when the company is wrangling with the UAW and Trump over ending production at a car plant about a four-hour drive away in Lordstown, Ohio.

After lambasting GM on Twitter over the weekend, Trump held a rally Wednesday in Lima, Ohio, where he again told the carmaker to either reopen the factory or offload it to a company that will.

GM’s plans for Orion may not be enough to appease Trump, whose lashing out is probably linked to efforts to keep Ohio voters in his corner for the 2020 election. But the investment it’s announcing Friday is expected to create new jobs or transfer opportunities for workers at plants including Lordstown — and another in the Hamtramck area near Detroit — that are scheduled to be idled or closed by early next year.

Trump has targeted GM for criticism ever since the company said it had no future product allocated to five North American plants — four of which are in the U.S. — and cut upwards of 14,000 jobs. Not all of those employees have been dismissed, with some having to move to plants in Michigan, Tennessee, or Texas to stay employed. GM already has relocated 1,000 of the 2,800 affected U.S. hourly workers to other plants, including 500 from Lordstown.

In anticipation of Trump’s visit to Ohio, GM sought the help of the Center for Automotive Research to help build a defense against the president’s barbs. A GM spokesman shared data compiled by the nonprofit researcher showing the carmaker invested about $21 billion in the U.S. since 1010, the year it after it emerged from bankruptcy. That was about a quarter of the total investment made by all automakers.

At the same time, GM has ramped up its operations in Mexico. Last year, the company imported almost 1 million vehicles into the U.S. from Nafta neighbors, with most coming from Mexico. It’s now the leading U.S. importer of vehicles built south of the border.

In a move that may have amped up the pressure on GM to respond to Trump’s attacks, rival Ford Motor Co. on Wednesday announced a $900 million investment planned for southeast Michigan facilities, the bulk of which will go to producing electric vehicles at a plant in Flat Rock, south of Detroit. That news landed hours before Trump started his rally in Ohio.