Trump's effort to reschedule the trip reflected the Republican president's eagerness to project confidence in a challenging Middle East war and simultaneously to manage a tense relationship between the world's biggest economies.
Initially slated to travel next week, Trump will now visit Beijing on May 14 and 15, he said in a Truth Social post on Wednesday.
Trump added that he would host Xi for a reciprocal visit in Washington later this year.
"Our Representatives are finalizing preparations for these Historic Visits," Trump said. "I look very much forward to spending time with President Xi in what will be, I am sure, a Monumental Event."
China's embassy said it had no information to provide on the announcement of the visit. Beijing normally does not detail Xi's schedule more than a few days in advance.
The long-scheduled trip - and Washington's broader effort to reset relations in the Asia Pacific region - have been repeatedly overtaken by events.
In February, the Supreme Court curtailed the US president's power to impose tariffs, a source of leverage for Trump in negotiations with the US' third-biggest trading partner. Later that month, Trump's joint military operation with Israel against Iran introduced a new point of tension with Beijing, Tehran's main oil buyer.
Trump's last trip to China, in 2017, was the most recent by a US president. Trump's visit in May will be the leaders' first in-person talks since an October meeting in South Korea, where they agreed on a trade truce.
The two-day trip is set to combine the lavish pomp and circumstance that has become a feature of Trump's trips abroad with hard-nosed diplomacy.
While the two sides could strike goodwill agreements in Beijing on trade in agriculture and plane parts, they are also expected to discuss areas of deep tension like Taiwan, where little progress is expected.
Trump has dramatically ramped up US arms sales to Taiwan during his second term in office. The moves have angered Beijing, which claims the democratically governed island as its own territory.
It is also not clear whether the war with Iran, which has shaken the global economy, will be settled by the time of the Xi-Trump meeting.
Trump has sought support from the world's major oil consumers, including China, to help counter Iran's efforts to close the Strait of Hormuz.
Trump's request for assistance so far has largely been rebuffed. China, which imported around 12 million barrels of oil daily during the first two months of 2026, the most in the world, has not directly responded to his request.
Asked whether the war could wind down in time for the China trip, White House spokeswoman Karoline Leavitt told reporters on Wednesday that "we've always estimated approximately four to six weeks. So you could do the math on that."
Leavitt also said Trump and Xi spoke about rescheduling the trip and that Xi had understood the reasons for doing so.
"President Xi understood that it's very important for the president to be here throughout these combat operations right now," she said.