US President Barack Obama has reaffirmed his support for Japan in its row over islands with China, after talks with Prime Minister Shinzo Abe.
Obama, who is on a four-nation Asia tour, warned against escalation in the dispute and said he wanted to see the row resolved peacefully.
But he confirmed that the islands fell under a security treaty that commits the US to act if Japan is attacked.
The two leaders also discussed a major trade deal and North Korea.
The US president arrived in Japan late on Wednesday ahead of stops in South Korea, Malaysia and the Philippines.
He is not going to Beijing but relations with China are expected to dominate his meetings with regional leaders.
Obama's trip - which ends on 29 April - comes nearly seven months after he cancelled a visit to the region because of a US government shutdown.
Officials say it is aimed at reassuring America's Asian allies of its commitment to the region amid concern over China's growing power.
On Wednesday Obama had an informal dinner with Abe. The two leaders then held talks on Thursday morning and gave a joint press conference.
The region has welcomed renewed American engagement to balance an assertive China. Each country Obama visits has some kind of territorial dispute with China and will be looking for assurances the US will be there if push ever comes to shove.
Obama faces a delicate balancing act, reasserting America's commitment to the region and the importance of its security relationships without feeding China's concerns that Washington's actual policy is not engagement but containment.
Obama's Asia tour 'reassures allies'
"Article five [of the US-Japan security treaty] covers all territories under Japan's administration including [the] Senkaku islands," Obama said, echoing comments published in Wednesday's Yomiuri newspaper. "We do not believe that they should be subject to change unilaterally."
"This is not a new position. This is a consistent one," he said.
However, Obama also said he told Abe that it "would be a profound mistake to continue to see escalation around this issue instead of dialogue".
The islands are called Senkaku and Japan and Diaoyu in China. Japan controls the islands but China has been strongly pressing its claim in recent months, flying and sailing vessels in and out of what Japan says are its waters and airspace.
Japan depends on the US for its security, under a decades-old alliance that dates back to the end of World War Two. If Japan is attacked, the US is obliged to come to its aid.
"The so-called US-Japan alliance is a bilateral arrangement from the Cold War and ought not to harm China's territorial sovereignty and reasonable rights," spokesman Qin Gang said in Beijing.
Abe and Obama also discussed the Trans-Pacific Partnership, a giant trade deal involving 12 nations.
It is currently stalled partly due to a row between the US and Japan over agricultural tariffs.
North Korea was also expected to be on the agenda. Obama wants Tokyo and Seoul to work together on the issue, but ties between the two remain badly strained because of war-related historical issues.
The US president flies to Seoul after Tokyo, amid reports of increased activity at Pyongyang's nuclear test site - potentially suggesting a fourth nuclear test could be imminent.
"China's participation in pushing the DPRK [North Korea] in a different direction is critically important," Obama said.