(CNN) US Defense Secretary James Mattis on Saturday reaffirmed Washington's commitment to defending Japan, including a group of disputed islands which have been claimed by China.

"I made clear that our long-standing policy on the Senkaku Islands stands -- the US will continue to recognize Japanese administration of the islands and as such Article 5 of the US-Japan Security Treaty applies," Mattis said in a press conference with Japanese Defense Minister Tomomi Inada.

Article 5 of that treaty says the US will defend territories under Japanese administration, which would include the Senkakus, an uninhabited group of islands in the East China Sea called the Diaoyus by China.

Tensions have flashed numerous times in recent years over the islands, including face-offs between Japanese and Chinese air and naval forces that have been termed dangerous by both sides.

China responded quickly to the US stance on the disputed islands, saying it brings instability to the region.

"Diaoyu and its affiliated islands have been Chinese territory since ancient times. These are historical facts that cannot be changed. The so-called US-Japan security treaty was a product of the Cold War, and it should not harm China's territorial sovereignty and legitimate rights," Chinese Foreign Ministry spokesman Lu Kang said in a statement.

"We urge the US side to adopt a responsible attitude and stop making wrong remarks on the issue of the sovereignty of Diaoyu Islands," Lu said.

JUST WATCHED US displays its military power in the Pacific Replay More Videos ... MUST WATCH US displays its military power in the Pacific 02:17

Mattis' visit to Japan and South Korea follows a campaign in which President Donald Trump unsettled the region by suggesting that Seoul and Tokyo develop their own nuclear weapons and pay more towards keeping US troops stationed in the two countries.

But in his inaugural trip as secretary of defense, Mattis has repeatedly reassured the staunch US allies of the Trump administration's commitment to the region.

"I want there to be no misunderstanding during the transition in Washington that we stand firmly, 100% shoulder to shoulder with you and the Japanese people," Mattis said.

Contested waters

The US commitment to the disputed islands, which Mattis also reaffirmed in a Friday night meeting with Japanese Prime Minister Shinzo Abe, is not new. In 2014, the Obama administration also said the remote chain fell under the treaty.

In late 2013, China declared an air defense identification zone (ADIZ) over much of the East China Sea, including the Senkakus, despite objections from Tokyo and Washington.

Japan also has an ADIZ over the islands. While the Senkakus are uninhabited, their ownership would allow for exclusive oil, mineral and fishing rights in the surrounding waters.

'Shredded the trust'

Mattis was also critical of China's actions in the South China Sea , where since 2014 Beijing has turned sandbars into islands, equipping them with airfields, ports and weapons systems and warned US warships and aircraft to stay away from them.

"China has shredded the trust of nations in the region," Mattis said.

"We all play by the rules, and if we have disputes we take them to arbitration, we don't settle them by taking military means and occupying land that is subject to question, to say the least, about who actually owns it," he said.

Mattis said the US Navy would continue to exercises freedom of navigation rights -- where US warships sail through international waters -- in the South China Sea, there was no need for increased US military maneuvers there.

"What we have to do is exhaust all efforts, diplomatic efforts, to try and resolve this properly," Mattis said.

Inada said Japan supported US actions in the South China Sea and said Tokyo would play a "proactive role" in regional disputes.

The defense chiefs also discussed the threat posed by North Korea.

"Evolution of North Korea's nuclear and missile development is for Japan and the US and for the region's security a grave threat," Inada said.

She also stressed that the US, Japan and South Korea face the North Korean threat with a division of roles, emphasizing the importance of the deterrence value of US first-strike capabilities, something Japan's constitution prevents its military from having.

Who pays?

In Saturday's press conference, Mattis praised Japan's financial contribution to the cost of keeping some 52,000 US troops in Japan. During the US presidential campaign, Trump had said Japan might have to increase its contribution to the force.

"Japan has been a model of cost sharing and burden sharing," Mattis said, calling Japan "an example for other nations to follow."

The US defense chief also praised Japan's military buildup under Prime Minister Shinzo Abe, which has seen increased spending on Japanese forces to the point that some analysts consider them among the world's best

"I think Japan is on the right track," Mattis said.

JUST WATCHED New strains on U.S. bases in Japan Replay More Videos ... MUST WATCH New strains on U.S. bases in Japan 02:24

Mattis said the US would continue taking steps to lessen the US military footprint on the southern Japanese island of Okinawa.

Both sides agreed the US Marine Corps Air Station Futenma on Okinawa would be relocated to Henoko, a less densely populated section of the island, Inada said.

'Overwhelming' response

Mattis arrived in Tokyo on Friday from South Korea, the first stop in his first overseas trip as US defense secretary.

While in Seoul, he he pledged to deploy THAAD -- the Terminal High Altitude Area Defense anti-missile system -- to protect US and South Korean troops.

"North Korea continues to launch missiles, develop its nuclear weapons program and engage in threatening rhetoric and behavior," Mattis said at a press conference in Seoul on Friday.

JUST WATCHED US aims to reassure alliance with S. Korea Replay More Videos ... MUST WATCH US aims to reassure alliance with S. Korea 01:46

Speaking alongside South Korean Defense Minister Han Min-koo, he added: "Any attack on the United States or on our allies will be defeated and any use of nuclear weapons will be met with a response that will be effective and overwhelming."

A statement on Pyongyang's Korean Central News Agency said deployment of THAAD is pushing the Korean peninsula to the "brink of a nuclear war."

The statement said THAAD was part of an offensive strategy between Seoul and Washington, alleging the two had "worked out a plan for a preemptive attack on the North and ... desperately pushed forward it, pushing the situation on the peninsula to the brink of a nuclear war."

On Thursday Mattis said Pyongyang's "provocative behavior" made THAAD necessary.