Indonesian President Joko Widodo has said China's claims to the majority of the South China Sea have "no legal foundation in international law", according to a report in Japan's Yomiuri newspaper.
The comments were the first time Widodo, who took office in October, has taken a position on the South China Sea dispute.
The English version of the interview was published by Yomiuri on Monday in advance of Widodo's visits to Japan and China this week,
Indonesia, the largest country in Southeast Asia, has been a self-appointed broker in the many territorial disputes between its neighbours and China over the South China Sea.
"We need peace and stability in the Asia-Pacific region. It is important to have political and security stability to build up our economic growth," Widodo was quoted as saying.
"So we support the Code of Conduct [of the South China Sea] and also dialogue between China and Japan, China and ASEAN."
Widodo is scheduled to hold talks with Shinzo Abe, the Japanese prime minister, on Monday.
Widodo confirmed that he and Abe would sign a defence cooperation agreement that would cover "how to work with" Japan's military, and "search and rescue operations, humanitarian assistance, and cyber defence",Yomiuri reported.
Japan has already bolstered partnerships with the Philippines and Vietnam, the two countries most at odds with China over territorial rows 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.
Widodo also said he hoped to discuss maritime cooperation with Japan's coast guard "because Japan has good experience to manage its waters", the newspaper reported.
Widodo will visit China immediately after his stop in Japan.
Indonesia and China have a more developed military relationship, with the former having bought Chinese-made missiles and other military hardware.