Ford CEO Mark Fields is out after less than three years on the job.

Fields, a career Ford employee, was replaced Monday by Jim Hackett, who was brought in last year to run Ford's efforts to develop self-driving vehicles.

Fields, 56, has worked for Ford for nearly 28 years. He became CEO in 2014, succeeding Alan Mulally, who is credited with turning Ford around and keeping it out of bankruptcy when rivals GM (GM) and Chrysler went bankrupt in 2009.

Hackett, 62, is the former CEO of office furniture company Steelcase. He joined Ford's board of directors in 2013. His biography on the Ford website says that he helped transform the firm "from traditional manufacturer to industry innovator."

Related: Ford cutting 1,400 jobs

Ford posted record profits under Fields in 2015 as U.S. auto sales climbed to yet another record. But sales momentum has slowed since then, and Ford's profit narrowed slightly last year as its U.S. sales slipped and it lost market share.

In the first quarter of this year, profit and sales fell more sharply as Ford invested in new technology including electric and self-driving cars, two areas where it trails some competitors such as GM.

Related: Auto sales are slowing, and upheaval is next

Ford announced plans last month to cut costs by $3 billion a year to free up money for that new product development. Last week, the carmaker said it plans to cut about 1,400 jobs, roughly 10% of its salaried staff.

Ford and other traditional automakers face competition from upstarts such as electric car maker Tesla (TSLA) and ride-hailing service Uber, which reduces the need for some people to buy their own cars. Deep-pocket tech giants such as Google (GOOGL) and Apple (AAPL) loom next as they work on their own programs for self-driving cars.

Partly because of those long-term challenges, Ford's stock price has sunk under Fields. It's down nearly 40% since he took the top job. Earlier this year, Tesla passed Ford and GM in the market value of its stock, despite having only a fraction of the sales.

Ford and Fields also faced challenges from the election of President Trump.

During the campaign, Trump regularly attacked Ford for shifting some production to Mexico, falsely claiming that the company planned on shifting all its U.S. factory jobs there.

He has threatened to impose a border tax on cars shipped from Mexico to the United States, which would greatly increase costs for Ford and other automakers.

Ford argued it was not eliminating any American jobs because of its plans to build all small cars in Mexico. In January, Fields announced that the company was dropping plans for a new plant in Mexico and would invest $700 million to create 700 jobs in Michigan working on electric and self-driving cars. He said it was a "vote of confidence" in the new administration.

The move turned Trump from a critic to a fan, and he repeatedly invited Fields to the White House, including to two meetings in his first week in office. But Ford is still going ahead with plans to shift all small car production to Mexico. Instead of moving that work to a new plant in Mexico, it will transfer to an existing location.

--CNNMoney's Rob McLean contributed to this report.