Cambodian Prime Minister Hun Sen, making a four-day visit to China, said Tuesday that Beijing has agreed to provide his nation with nearly $600 million in grant aid as part of a three-year assistance fund.

Hun Sen announced the aid from Cambodia’s most important political and economic ally on his Facebook page before any announcement by Beijing. He said the commitment was made by Chinese President Xi Jinping, whom he met Monday.

Hun Sen said the two countries also agreed to increase their bilateral trade to $10 billion by 2023 and Xi promised to buy 400,000 tons of rice from Cambodia in 2019 and push more Chinese businesses to invest in Cambodia. Two-way trade was about $6 billion in 2017.

He said he and Xi agreed to continue their friendship and cooperation in all fields. According to Hun Sen, Xi “said the relationship between China and Cambodia is very crucial, if compared to other countries.”

The agreements come as some Western countries are threatening to impose economic sanctions on Cambodia for repressing democratic rights, judging last year’s general election neither free nor fair. The European Union, Cambodia’s biggest export market, is preparing to withdraw the duty-free access it offers most Cambodian goods. The EU decided to act after Hun Sen’s Cambodian People’s Party swept all 125 seats in last year’s polls following the dissolution of the sole credible opposition party by Cambodia’s Supreme Court.

Hun Sen, who has been in power for more than three decades, depended heavily on Western aid to help his country recover from years of war and unrest, but chafed at their insistence that human rights and democratic principles be observed. China’s increasing projection of influence in Southeast Asia and its offers of large amounts of aid and investment to Cambodia empowered Hun Sen to pay less heed to his Western critics. Much of Cambodia’s infrastructure in recent years has been financed by China and Chinese companies. China also agreed to write off debts and granted Cambodia tariff-free status for hundreds of items.

Chinese investment and workers have poured into Southeast Asia as part of Xi’s signature “Belt and Road” infrastructure development initiative. Cambodia in turn has done Beijing’s diplomatic bidding in the region, especially regarding China’s claims to most of the South China Sea.

China has been a close ally of Cambodia since the 1970s, when it backed dictator Pol Pot’s 1975-79 genocidal Khmer Rouge regime that left nearly 2 million Cambodians dead.

Hun Sen, 66, has combined guile and strong-arming to dominate his country’s politics. He declared before last year’s election that he intended to serve two more terms in office.

Cambodian Prime Minister Hun Sen, top left, chats with Chinese Premier Li Keqiang during a signing ceremony at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan, Pool)
Cambodian Prime Minister Hun Sen, top left, chats with Chinese Premier Li Keqiang during a signing ceremony at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan, Pool)
Cambodian Prime Minister Hun Sen, right, walks with Chinese Premier Li Keqiang during a welcome ceremony at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan)
Cambodian Prime Minister Hun Sen, right, walks with Chinese Premier Li Keqiang during a welcome ceremony at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan)
Cambodian Prime Minister Hun Sen, second left, reacts as he inspects a Chinese guard of honor with Chinese Premier Li Keqiang at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan)
Cambodian Prime Minister Hun Sen, second left, reacts as he inspects a Chinese guard of honor with Chinese Premier Li Keqiang at the Great Hall of the People in Beijing, China, Tuesday, Jan. (AP Photo/Ng Han Guan)