Japan's Prime Minister Shinzo Abe and U.S. President Donald Trump attend a family photo session in front of Osaka Castle at the G-20 summit, in Osaka, Japan June 28, 2019 Tomohiro Ohsumi/Pool via REUTERS

OSAKA (Reuters) - U.S. President Donald Trump on Saturday said he told Japanese Prime Minister Shinzo Abe that a decades-old security treaty between their countries must be changed, reiterating his criticism of the pact as unfair.

Trump said he was not planning to withdraw from the treaty, which the partners have long called a linchpin of Asia-Pacific stability, but that it placed too great a burden on the United States.

“I told him, we’ll have to change it,” Trump told a news conference after a two-day summit of the Group of 20 major economies in Japan’s western city of Osaka.

“I said, look, if someone attacks Japan, we go after them and we are in a battle, full force, in effect,” he added. “If somebody should attack the United States, they don’t have to do that. That’s unfair.”

The treaty, signed after Japan’s surrender in World War Two, commits the United States to defend Japan.

In return, Japan provides military bases that Washington uses to project power deep into Asia, including the biggest concentration of U.S. Marines overseas on Okinawa, and the forward deployment of an aircraft carrier strike group at the Yokosuka naval base near Tokyo.

An end to the security pact is widely seen as raising the risk of forcing Washington to withdraw a major portion of its military forces from Asia at a time when China’s military power is growing.