Japan will sign a defense pact with Indonesia next week, officials in both governments said, the latest effort by Tokyo to forge closer security ties with Southeast Asian nations and build a counterbalance to China.

Japan has already bolstered partnerships with the Philippines and Vietnam, the two countries most at odds with China over a territorial row in the South China Sea. Japan itself is embroiled in a bitter dispute with China over uninhabited islands in the East China Sea, further to the north.

Indonesian President Joko Widodo visits Tokyo next week for talks with Prime Minister Shinzo Abe and the two sides will sign an agreement on increasing cooperation in military training and technology, the officials said. Currently, the two countries only have an agreement for the exchange of military students.