This took place on Friday.
"The question now is: Are words followed by action?" Obama said, standing alongside Xi at a White House news conference.
Obama's wariness underscored deep U.S. concerns about what officials say is China's massive cyber campaign to steal trade secrets and intellectual property from American companies. While China has publicly denied being behind such activities, U.S. officials say their counterparts in Beijing have begun to take the matter more seriously, as well as the potential impact on ties with Washington.
"Confrontation and friction are not the right choice for both sides," Xi said, speaking through an interpreter.
The spying tensions cast a shadow over Xi's state visit to Washington, a grand affair complete with a formal welcome ceremony and a black-tie dinner. Obama faced criticism from some Republicans for honoring China with a state visit given the cyber concerns, as well as U.S. worries about Beijing's human rights abuses and assertive posture in territorial disputes in the East and South China Seas.
While the latter issues were discussed during Obama and Xi's lengthy talks, no discernable progress was made.
Xi said the Chinese have "the right to uphold our own sovereignty" in the South China Sea, where Beijing has alarmed its neighbors with a major campaign of artificial island-building. China has reclaimed about 3,000 acres of land in the past year-and-a-half by dredging sand from the ocean bed.
On human rights, long a divisive issue between the U.S. and China, Xi made no commitments, saying only that countries must have the right "to choose their own development independently."
Obama and Xi did herald progress on climate change, one of the few areas of bilateral cooperation that has proceeded smoothly in recent months, largely because Beijing has struggled to contain heavy air, water and soil pollution that has destroyed farmland, sent cancer rates soaring and left its cities cloaked in dense smog.
In conjunction with the state visit, Xi announced a blueprint for a nationwide cap-and-trade system beginning in 2017 that would cover highly polluting sectors ranging from power generation to papermaking. China also said it will commit $3.1 billion to help developing countries reduce carbon emissions.
At the same time, Obama has warned that progress on climate change and other issues could be threatened by China's continued cybertheft of intellectual property.
U.S. officials say that while they regularly hack Chinese networks for espionage purposes, they don't steal corporate secrets and hand them to American companies. Chinese officials traditionally have viewed that distinction as meaningless, saying that national security and economic security are inextricably linked.
Ahead of Xi's visit to Washington, the U.S. administration had been preparing economic sanctions in retaliation for Chinese cybertheft. However, officials decided to hold off on the penalties in hopes that an accord like the one announced Friday could be reached.
Still, Obama said the possibility of sanctions against individuals or entities remains on the table.
"We will apply those, and whatever other tools we have in our tool kit, to go after cybercriminals either retrospectively or prospectively," he said.
The agreement to clamp down on the theft of trade secrets doesn't address the theft of national security information, such as the tens of millions of U.S. federal personnel records that American lawmakers and some U.S. officials have said was engineered by Beijing. Obama has declined to publicly assign blame to China for that breach.
American officials have said the U.S. data was a legitimate intelligence objective — and the type of thing that Washington itself might target in other countries.
U.S. businesses welcomed the cyber agreement, though some were cautious about the prospects of China following through.
"While a diplomatic agreement is an important first step, retailers will measure the success of these efforts by China's actions moving forward," said Nicholas Ahrens, vice president of privacy and cybersecurity for the Retail Industry Leaders Association, a trade group that includes such members as Best Buy, Sears and Wal-Mart.
Jeremie Waterman, executive director for China at the U.S. Chamber of Commerce, said he hoped the agreement "marks a new chapter" and leads to real progress. Like the president and others, he said the key will be how well the agreement is implemented.