Washington and Beijing have been at loggerheads over key issues ranging from trade tariffs to the Middle East war and Taiwan, which China claims as part of its territory.
Trump was originally meant to visit in late March or early April, but postponed his trip to focus on the Iran war.
"At the invitation of President Xi Jinping, President of the United States of America Donald J. Trump will pay a state visit to China from May 13 to 15," a Chinese foreign ministry spokesperson said.
Trump is expected to push Xi on Iran while aiming to ease trade tensions, according to US officials.
China is a key customer for Iranian oil, mainly through independent "teapot" refineries that rely on discounted crude from the Islamic republic.
"This will be a visit of tremendous symbolic significance," US Principal Deputy Press Secretary Anna Kelly told reporters on a call.
"But of course, President Trump never travels for symbolism alone. The American people can expect the president to deliver more good deals on behalf of our country."
Trump's first trip to China in his second term will feature pomp and ceremony including a tour of the Temple of Heaven in Beijing and a lavish state banquet, the White House said.
This is the first visit by a US president to China since 2017.