The world's two biggest economies have been trying to ease tensions amid mutual accusations of hacking and Internet theft.
In a phone call with Xi, Obama said he looked forward to welcoming him to Washington for a state visit later this year, the White House said in a statement on Tuesday.
Chinese state news agency Xinhua said on Wednesday that Xi would visit in September.
"During the conversation, both sides agreed to make full preparations to ensure the success of the trip," the report said.
The White House added: "The two leaders reaffirmed their commitment to coordinate closely on security challenges, including by jointly encouraging Iran to seize the historic opportunity presented by P5+1 negotiations."
The nuclear talks with the United States, Russia, China, Britain and France are aimed at clinching an accord that would ease Western concerns that Tehran could pursue a convert nuclear weapons programme, in return for the lifting of sanctions that have ravaged the Iranian economy.
Negotiators have set a June 30 final deadline for an accord, and Western officials have said they aim to agree on the substance of that deal by March.
Xinhua also cited Xi as saying he "hopes the US side can pay attention to China's concerns on the Taiwan and Tibet issues, and prevent China-US relations from suffering unnecessary interference".
China has been angered in the past by US weapons sales to Taiwan, which has been ruled separately since defeated Nationalist forces fled to the island at the end of a civil war in 1949.
Beijing also regularly warns against foreign support of exiled Tibetan spiritual leader, the Dalai Lama, who it sees as a "splittist" seeking to establish an independent Tibet.
© Thomson Reuters 2015
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.