Vladimir Putin and Xi Jinping spoke via video link at a summit of the Shanghai Cooperation Organisation (SCO), an eight-member group.
Putin said the organisation, holding its meeting in Tajikistan, should "use its potential" to "stimulate the new Afghan authorities" in fulfilling their promises on normalising life and bringing security in Afghanistan.
The hasty withdrawal of US-led forces had left behind "an open Pandora's box full of problems related to terrorism, drug trafficking, organised crime and, unfortunately, religious extremism," Putin said.
Partners should work with the new Afghan government, even if it was not representative, the Russian leader added.
Xi said it was necessary to "encourage Afghanistan to put in place a broad-based and inclusive political framework" and to "resolutely fight all forms of terrorism" and live in peace with its neighbours.
Like Putin, Xi did not attend the summit held in the Tajik capital Dushanbe in person, addressing the meeting by video link instead.
Moscow and Beijing have moved to assert themselves as key players in Central Asia, after the United States' hasty retreat from Afghanistan and the Taliban's takeover of the country.
China shares a 76-kilometre-long (47 mile) border with Afghanistan.
Countries allied with Russia and China were holding a series of meetings in Dushanbe this week. (AFP)