Chinese President Xi Jinping arrived in Cambodia for a two-day visit on Thursday, praising the close ties that have seen Cambodia side with Beijing on the South China Sea, and signed dozens of economic agreements.

Thirty-one agreements, including soft loan deals of around $237 million, were signed on Thursday following the meeting between Xi and Prime Minister Hun Sen, according to Eang Sophalleth, an aide to Hun Sen.

Xi also pledged to urge Chinese investment in building Cambodia’s high-speed train and an airport in Siem Reap province, as well as provide additional 500 scholarships, Sophalleth said.

The Chinese leader has also cancelled around $89 million debt, he added.

“This is historic in term of the number of agreements signed and pledges,” Sophalleth said, adding that Beijing had also pledged another $14 million in military aid.

Cambodia has shielded Beijing from criticism by the Association of Southeast Asian Nations (ASEAN) over the South China Sea.

ASEAN members Vietnam, the Philippines, Malaysia and Brunei are in disputes with China over rival claims to the waters.

In a joint statement issued after the meeting and posted on China’s Foreign Ministry website said both agreed the South China Sea was not an issue between China and ASEAN, and that it should be resolved via talks between the countries directly involved.

Last month, Cambodia was able to veto an ASEAN statement referring to a ruling at an international tribunal earlier in the year that largely denied Beijing’s claims.

China and Cambodia were “good neighbours, real friends who are loyal to each other”, Xi wrote in a front-page commentary in Cambodia’s biggest Khmer-language newspaper, Rasmei Kampuchea.

Xi said bilateral trade reached $4.4 billion last year and was set to reach $5 billion next year.

Chinese investment in Cambodia was valued at $864 million last year and a total of $9.1 billion has been pledged since 1994, according to the Council for the Development of Cambodia.

This year, China has pledged $600 million in aid to Cambodia over the next three years.

China has become Cambodia’s closest ally while relations between Cambodia and Western powers, including the United States and European Union, are frequently strained by differences over human rights.

Miguel Chanco, regional lead analyst for the Economist Intelligence Unit, said Xi’s visit represented a Chinese reassurance amid rising criticism from the West over a crackdown on government critics before a 2018 general election.

“China’s continued support of Cambodia, both economically and in the arena of international politics, will mean that the Hun Sen regime is unlikely to soften its heavy-handedness anytime soon,” Chanco said.