Describing cybersecurity concerns as “uncharted waters,” President Obama said during a meeting here late Friday with Chinese President Xi Jinping that their two countries must arrive at a “firm understanding” of how to regulate cyberattacks and computer hacking.

Following three hours of private meetings at the start of a relaxed two-day summit at an expansive California desert retreat, Obama said he and Xi so far had discussed cybersecurity only “at the 40,000-foot level.”

Although U.S. officials have grown increasingly concerned about China’s hacking of private records of American companies, both Obama and Xi, publicly at least, stopped short of directly confronting the contentious issue.

When a U.S. journalist pressed Xi on the cyber-spying, the Chinese leader asserted that China, too, is a victim of such attacks — and he faulted the news media with leaving what he considers a misleading impression that the threat comes mostly from China. Xi pledged to resolve concerns with the United States “in a pragmatic way.”

As Obama and Xi’s high-stakes talks got underway Friday, the State Department announced that China had agreed with the United States, Russia and other major nations that international law applies to actions that states take in cyberspace — a significant step toward ensuring that civilians and civilian systems such as energy grids are not targeted in cyberattacks.

China’s agreement at the United Nations culminates a multiyear effort by 15 countries to reduce tensions in cyberspace and comes amid growing concerns of top U.S. officials about China’s hacking into the private records of U.S. corporations and American institutions.

Here in California, Obama and Xi also began discussing several other issues that are sensitive for the Chinese that have bedeviled U.S. and Chinese leaders for years, including human rights, climate change and North Korea’s nuclear provocations.

Obama is seeking to cultivate a personal relationship with Xi, China’s newly minted leader, inviting him to a friendly, so-called shirt sleeves summit at Sunnylands, an historic 200-acre estate in this golf resort destination on the edge of the Mojave Desert.

Relieved of the diplomatic pageantry that comes with a formal state visit, Obama hopes this get-to-know-each-other session might smooth the sometimes volatile relationship between the United States and the rising Asian power.

As temperatures reached 115 degrees on Friday, Obama and Xi — each wearing an open-collared white shirt and suit coat but no tie and flanked by senior officials in his government — exchanged warm words.

Xi, speaking through a translator, said he hopes the talks might “chart the future of China-U.S. relations.” He posited that the “Chinese dream” of economic prosperity and national renewal is connected to the “American dream.”

Obama, meanwhile, promised a “new model of cooperation” between the rival nations. “The United States welcomes the continuing peaceful rise of China as a world power,” Obama said, a line he later repeated.

On climate change, Obama said, “that’s an issue we’ll have to deal with together.”

And on cybersecurity, Obama said he hoped to delve deeper into a discussion of the issue at a private dinner Friday night.

“In some ways these are uncharted waters and you don’t have the kinds of protocols that cover military issues, for example, and arms issues, where nations have a lot of experience in trying to negotiate what’s acceptable and what’s not,” Obama said.

He added, “It’s critical, as two of the largest economies and military powers in the world, that China and the United States arrives at a firm understanding of how we work together on these issues.”

Separately, the consensus China reached with the United States and several other nations paves the way for deeper international discussions about how the principles of international law should apply in this emerging realm of cyberspace warfare.

State Department spokeswoman Jen Psaki said in a statement Friday evening that the agreement “sends a strong signal: states must act in cyberspace under the established international rules and principles that have guided their actions for decades — in peacetime and during conflict.”

The agreement is not binding, but is a major achievement given China’s earlier reluctance to affirm the idea that international law governs actions in cyberspace, just as it does in traditional warfare.

“The Chinese really didn’t have any choice but to agree because they couldn’t afford to derail the agreement right before the summit,” said James A. Lewis, a rapporteur hired by the United Nations to draft the agreement.

The agreement is significant, too, in that Russia, China, the United States and other major allies agreed for the first time on a framework for rules on cyber-conflict, said Lewis, who is a cyber policy expert at the Center for Strategic and International Studies.

Here at Sunnylands, Obama, sitting across from Xi, acknowledged that “inevitably there are areas of tension between our countries.”

Obama pointed to the global economy as one such area, saying the United States “seeks an international economic order where nations are playing by the same rules, where trade is free and fair and where the United States and China work together to address issues like cybersecurity and protection of intellectual property.”

Xi, who took office in March, immediately assumed control of China’s presidency, the military and the Communist Party. Obama, Vice President Biden and his foreign policy advisers have been cultivating Xi for two years and are encouraged by what they see in him so far.

“I think that both of us agree that continuous and candid and constructive conversation and communication is critically important to shaping our relationship for years to come,” Obama said.

Xi, who declared the Sunnylands summit “a new historical starting point” after China and the United States reopened diplomatic relations 40 years ago, spoke of his country as a global super power now on par with the United States.

“How can our two nations join together to promote peace and development in the world?” Xi asked. “These are things that not just the people in our two countries are watching closely, but the whole world is also watching very closely. … We need to think creatively and act energetically so that working together we can build a new model of major country relationship.”

Nakashima reported from Washington.