KABUL—Russia is making fresh inroads into Afghanistan that could complicate U.S. efforts to strengthen the fragile Kabul government, stamp out the resilient Taliban insurgency and end America’s longest war.

Moscow last month disclosed details of contacts with the Taliban, saying that it is sharing information and cooperating with the radical movement on strategy to fight the local affiliate of Islamic State, which has gained a foothold in eastern Nangarhar province, on the border with Pakistan.

Moscow’s ambassador to Afghanistan, Alexander Mantytskiy, and other Russian officials said the cooperation with the Taliban didn’t include supplying it with money or materiel. Taliban spokesman Zabiullah Mujahid described the relationship as “just political.”

But the revelation coincides with other Russian moves in Afghanistan that appear aimed, as in the Middle East and Europe, at undermining U.S. influence and seeking regional parity with Washington.

The Kremlin held a conference in Moscow last month with China and Pakistan to discuss terrorist threats from Afghanistan and how to combat Islamic State. Since then, Russia has invited the Afghan government to participate in the continuing diplomatic initiative, but not the U.S.