TAIPEI, Taiwan >> Days after Apple’s CEO met with President Donald Trump, the company said Monday that it planned to spend $500 billion and hire 20,000 people in the United States over the next four years and open a factory in Texas to make the machines that power the company’s push into artificial intelligence.

“We are bullish on the future of American innovation, and we’re proud to build on our long-standing U.S. investments,” Tim Cook, Apple’s CEO, said in a statement. The company made similar, smaller pledges during the Biden administration and Trump’s first term, though it has not yet followed through on some of those promises.

Cook met with Trump last week. After that meeting, Trump said Apple would shift production to the United States: “They’re going to build here instead because they don’t want to pay the tariffs,” he said in a speech to a gathering of governors.

With its investment, Apple said it would begin manufacturing AI servers at a new 250,000-square-foot facility in Houston next year. Those servers, which will be made by Taiwanese electronics giant Foxconn, will help the company expand its data center capacity in North Carolina, Oregon, Arizona and Nevada.

Apple will continue to make the bulk of what it sells — iPhones, iPads and Macs — in Asia. Its overseas manufacturing footprint has been a point of contention with Trump since before he was first elected president in 2016. For years, he has called on Apple to “start building their damn computers and things in this country, instead of in other countries.”

As the first Trump administration ratcheted up tariffs on China in 2019, Apple began shifting some of its manufacturing to Vietnam, India and other Asian countries. But it didn’t bring any of that production back to the United States.

Now, Apple is facing tariffs for the first time on iPhones and the threat of tariffs on other products made overseas. The majority of iPhones are made in China and U.S. tariffs of 10% on all Chinese products took effect this month. Trump has also threatened reciprocal tariffs on India, as well as levies on imports from Canada, Mexico and other major trading partners.Cook has worked with Trump in the past to help Apple avoid tariffs. The Trump administration avoided putting levies on smartphones and removed, at Apple’s request, a tariff on the Apple Watch in 2020.

Gene Munster, managing partner at Deepwater Asset Management, said he expects that Apple would again be spared from tariffs because of its promise to invest $500 billion in the United States.

The investment represents $39 billion in annual spending above what Apple promised to spend on employees and suppliers in the United States in 2021, he said. It is in line with Apple’s average annual increase in U.S. investment to support its growth since 2017. And the 20,000 jobs that Apple said it would add is in line with the number of people it would hire over a four-year span in the United States, as well.

“This is a calculated trade-off for tariffs,” Munster said. “Trump made it clear: You have to show me some love. The question is: How much is that worth to Apple? And the answer is they would rather spend this money themselves on infrastructure than give it to Uncle Sam.”

He added, “This is what you have to do to navigate the new world order, and Tim Cook is really good at it.”

Apple and the White House didn’t immediately have comment.

Apple is the latest in a series of companies to make investment commitments in the United States after Trump’s election. In December, SoftBank, a Japanese technology company, committed to invest $100 billion in the United States and create 100,000 jobs. A month later, SoftBank, OpenAI and Oracle pledged to spend $500 billion over the next four years on infrastructure for AI.

Companies have mixed records of fulfilling their promises to Trump. In 2018, Apple promised to build a campus in a new location as part of a $350 billion investment, but it hasn’t yet done so. That same year, its partner Foxconn held a groundbreaking in Wisconsin for a $10 billion high-tech campus that would employ 13,000 people. Foxconn has built some buildings but not the promised plant.

But other companies like Toyota and Nucor, the U.S. steel producer, followed through on promises to invest billions of dollars by building plants in Kentucky that now employ thousands of people.

In 2021, Apple said it would invest $1 billion in North Carolina on a new campus in the Raleigh area. It later paused development of the project. Last year, it said it would develop the campus in the coming years.

Apple described its announcement Monday as its “largest-ever spend commitment.” The $500 billion would go toward manufacturing facilities, data centers and entertainment productions, the company said. Apple employs more than 150,000 people around the world.

Monday’s statement had echoes of prior Apple announcements.

Four years ago, a few months after Biden’s inauguration, Apple announced an “acceleration” of its U.S. investments, pledging to spend $430 billion and add 20,000 jobs over five years. In January 2018, during Trump’s first term, the company said its “direct contribution to the U.S. economy” would be $350 billion over five years and that it planned to create 20,000 jobs over that period.

Trump thanked Apple and Cook in a social media post Monday. Trump said the move showed that the company had “faith in what we are doing.”