As the U.S. seeks an exit from the Afghan war, Central Asia is on the cusp of a new era, with Russia and China vying for influence in a region that will no longer be dominated by America’s post-9/11 undertaking to bring peace and stability to Afghanistan.

The two countries are wary of Islamist militancy, both on their soil and spilling over from Afghanistan, while China wants to safeguard the billions of dollars its companies have invested in the region under President Xi Jinping’s Belt-and-Road Initiative, according to regional experts.

In recent years, Moscow and Beijing have taken more aggressive steps to protect their interests in the face of what they view as the weakening political grip of the American-allied government in Kabul, the expanding sway of the Taliban across Afghanistan, and the threat posed by Islamic State and other Islamist militant groups that have transnational agendas.

Since the Trump administration appointed Zalmay Khalilzad special envoy to the Afghan peace process in September, Mr. Khalilzad has taken pains to involve Moscow and Beijing in efforts to negotiate a comprehensive settlement of the nearly 18-year Afghan war, both to ensure their cooperation and to discourage Eurasia’s two great powers from acting as spoilers at a time when Washington’s ties with both capitals are strained on many other fronts.

So far, Mr. Khalilzad’s wooing appears to be paying off. Russian President Vladimir Putin last week praised the U.S.-Russian efforts on the peace process, saying he hoped they would produce “good results.” Mr. Putin made his comments as China hosted talks in Beijing with a delegation of Taliban officials headed by the movement’s chief negotiator, Mullah Abdul Ghani Baradar. A Chinese Foreign Ministry spokesman said he couldn’t confirm whether the meetings took place.