China on Wednesday welcomed the Taliban's formation of an interim government in Afghanistan, saying it is a necessary step for the nation to restore order at home and pursue post-war reconstruction.

Beijing has said that the Taliban, an Islamist group that returned to power last month after being ousted by U.S.-led forces in 2001, should set up a political structure that lays the foundation for lasting peace in Afghanistan.

"We noticed that the Afghan Taliban said that the interim government is formed to restore social and economic order as soon as possible," Chinese Foreign Ministry spokesman Wang Wenbin told reporters in Beijing.

"We hope Afghanistan will establish a broadly based and inclusive political structure, follow moderate and prudent domestic and foreign policies, resolutely combat all types of terrorist forces, and live on friendly terms with other countries," he added.

Later in the day, Foreign Minister Wang Yi said China will provide Afghanistan with $31 million worth of food, daily necessities and novel coronavirus vaccines, according to state-run media.

China has been cozying up to the Taliban, as the Asian power has been keen to prevent the group's political takeover in Afghanistan from encouraging separatist forces in China's mainly Muslim region of Xinjiang, which shares a border with the war-torn nation.

Beijing has been concerned that confusion in Afghanistan could provoke terrorism in the Xinjiang Uygur Autonomous Region, where many Muslims opposed to growing state surveillance have been detained under a "re-education" campaign, regional experts said.

On Tuesday, the Taliban announced an all-male interim government in Afghanistan.

But the new government -- which is made up mostly of Pashtuns, the dominant ethnic group within the Taliban -- is likely to struggle to win international recognition amid calls for an inclusive government that respects women's rights.