BEIJING - The leaders of China and Indonesia pledged to scale up trade and expand cooperation in areas such as agriculture and food security, following a rare visit to COVID-wary China by a foreign head of state.

Indonesian President Joko Widodo met Chinese President Xi Jinping and Premier Li Keqiang in Beijing on Tuesday. China last hosted foreign leaders during the Winter Olympics in February, with Russian President Vladimir Putin among those who visited Beijing.

The commitment by China, Indonesia's No.1 trading partner, to deepen trade relations and fully back Indonesia's chairmanship of the Association of Southeast Asian Nations (ASEAN) next year is an economic and political win for Jokowi, as the Indonesian president is widely known.

China hailed Indonesia as a model strategic partner, in contrast to its sharp words for the United States in recent months over issues from Taiwan and Ukraine to trade practices and the South China Sea.

"(China and Indonesia) have acted proactively and with a strong sense of responsibility to maintain regional peace and stability," according to the joint statement.

"They have thus set an example of major developing countries seeking strength through unity and win-win cooperation."

Indonesia is an important source of ferronickel, coal, copper and natural gas for the world's second-largest economy.

In the first half of 2022, Chinese imports from Indonesia, mostly commodities, surged 34.2% on year, the most after Russia.

China has expressed commitment to import an additional one million tonnes of crude palm oil from Indonesia, said the Indonesian state palace.

Jokowi met Li and Xi at the Diaoyutai State Guesthouse, part of a sprawling complex of villas, lakes and gardens where many foreign leaders, including the late U.S. President Richard Nixon, have been received.

As president of the G20 this year, Jokowi has sought to mend rifts within the group exposed by Russia's invasion of Ukraine.

Last month he travelled to Ukraine to meet President Volodymyr Zelenskiy and also to Moscow to hold talks with Putin. Jokowi said Indonesia was willing to be a "communication bridge" between the two.

China, while not condemning its strategic partner Russia for the invasion, has repeatedly called for a cessation of hostilities and has offered to help promote peace talks.

Both Indonesia and Russia are part of the G20, with the former holding the group's presidency this year.

Some G20 member-states have threatened to boycott this year's leaders summit, on the island of Bali on Nov. 15-16, if Putin attends.

Jokowi invited Xi to Indonesia to attend the November summit, according to their joint statement.

"President Xi expressed his gratitude and wished the summit a complete success," it said. (Reporting by Ryan Woo; Additional reporting by Stanley Widianto in Jakarta and Stella Qiu in Beijing; Editing by Michael Perry, William Maclean and Nick Macfie)