Prime Minister Shinzo Abe and Philippine President Rodrigo Duterte agreed Friday that a U.S. commitment to the Asia-Pacific is needed to ensure peace and prosperity in the region as uncertainty lingers over President-elect Donald Trump's foreign policy agenda.

Meeting for the second day in Duterte's hometown of Davao in the southern Philippines, the two leaders also touched on the issue of China's military buildup in the South China Sea and vowed to resolve disputes under the rule of law, the Japanese Foreign Ministry said.

The Philippines has conflicting claims with China in the disputed waters, along with four other countries.