Japan and the Philippines on Monday signed a key agreement that would facilitate mutual military visits, as the US allies tighten their defense ties amid lingering tensions with China.

Philippine President Ferdinand Marcos Jr. witnessed the signing of the Reciprocal Access Agreement, which he previously hailed as a boost to his country’s security. The signing took place as defense and foreign ministers of Japan and the Philippines are meeting in Manila on Monday.

The pact sets the stage for joint military trainings, like those conducted by the Philippines with US and Australia, with which Manila has similar defense arrangements.

It also dovetails with Marcos’ efforts to bolster ties with what he calls like-minded nations as his administration pushes back against Bejing’s sweeping claims in the South China Sea. Manila is also in talks for visiting forces agreements with France and Canada.

Japan has emerged as one of Manila’s major investors and strategic partners. Both nations are facing similar security challenges. The agreement was signed by Japan Foreign Minister Yoko Kamikawa and Philippine Defense Secretary Gilberto Teodoro.

Manila has been clashing with Beijing’s vessels in the South China Sea in recent months as both assert their claims in the crucial waterway. Tokyo has also been locked in a dispute with Beijing over century-old claims to a set of uninhabited islands in the East China Sea.

Japan has backed the Philippines in its effort to safeguard its maritime claims in the South China Sea, including in maritime patrols and defense equipment.

Japanese Prime Minister Fumio Kishida and Marcos Jr. earlier this year met with US President Joe Biden where they pledged to bolster security ties. Their countries also form an emerging regional group with Australia called the “Squad.”