ISLAMABAD (AP) — As Pakistan navigates its troubled relationship with the United States and scrambles to avoid being blacklisted for doing too little, too late to stop terror funding, regional alliances are shifting and analysts ponder whether a cozier relationship with countries like Russia will complicate efforts to move toward peace in neighboring Afghanistan.

Russia, analysts say, is motivated by fears of a growing presence of Islamic State militants in neighboring Afghanistan and has warmed up to Pakistan as well as to Taliban insurgents battling the upstart Islamic State group affiliate known as Khorasan Province, the ancient name of an area that once included parts of Afghanistan, Iran and Central Asia.

In the latest move to strengthen ties, Russia last week named an honorary consul to Pakistan's Khyber Pukhtunkhwa Province, which borders Nangarhar province in eastern Afghanistan, where IS has established its headquarters. The IS is also present in northern Afghanistan's border regions with Central Asia, causing further consternation in Moscow.

Russia's honorary consul, Mohammad Arsallah Khan, who belongs to a powerful business family in Pakistan's northwest, said economic development is the best weapon against extremism. To that end he said he will promote increased commerce with Pakistan's neighbors, including Russia, which currently accounts for barely $500 million in trade.

Mohammad Arsallah Khan was recently appointed Russia's honorary consul to Pakistan's Khyber Pukhtunkhwa Province, which borders Nangarhar province in eastern Afghanistan. (AP Photo/Anjum Naveed)

"I think this whole region is a bit of a mess, which I realize is one of the great understatements. Extremists have been taken lightly before and we are where we are because of that," said Khan in an interview in the Pakistani capital, Islamabad. Reflecting on his business-based strategy, Khan said, "when you can give people a way of earning a living, they will turn away from terrorism, away from extremism."

The appointment reflects a stark turnaround in Pakistan's historical relationship with Russia.

In the 1980s, Pakistan and the U.S. were united against Russia as the Soviet Union sent 150,000 soldiers into Afghanistan to prop up its communist ally in the Afghan capital, Kabul. At the time, Pakistan, with U.S. backing, used Peshawar as a staging arena to arm and deploy Islamic insurgents, referred to as mujahedeen — or as President Ronald Reagan often called them, "freedom fighters" — to wage war on Russia. After 10 years, Russia failed to win the war and on Feb. 15, 1989, left Afghanistan in a negotiated exit.

For some, Russia's cozying up to Pakistan is a bit of a "poke in the eye" to the U.S., still embroiled in the Afghan conflict that is now in its 17th year and is Washington's longest war, costing more than $122 billion, according to its own special Inspector General on Afghan Reconstruction.

Still, Petr Topychkanov, a senior researcher at the Stockholm International Peace Research Institute, said Russia worries about the U.S. presence in Afghanistan.

"Russia is concerned about the long-term presence of the U.S. and its allies in Afghanistan, and therefore it's in Russia's long-term interests to have an inside view of the situation in Afghanistan," he said, saying that Pakistan provides the viewing platform.

Pakistani commerce official Zahid Ullah Shinwari presents Russian Ambassador Alexey Yurievich Dedov iwith a souvenir plaque in the city of Peshawar. (AP Photo/Muhammad Sajjad)

Daniel Markey, senior research professor in international relations at Johns Hopkins University, said Russian relations with Pakistan aim to solve two problems for Moscow. First, to blunt the threat of IS from Afghanistan. Second, to undermine U.S. influence, he said.

"The point is that Russia and Pakistan probably have more in common with respect to the war in Afghanistan than the United States has with either __ and this is a real turnaround from prior history."

Last week Russia's Foreign Minister Sergey Lavrov accused Washington of failing to go after the Islamic State group in Afghanistan.

In response, Washington's senior diplomat for South Asia, Alice Wells, accused Russia of ignoring anti-IS offensives launched by U.S. and Afghan forces in eastern Afghanistan, while at the same time pursuing them in new havens, particularly in northern Afghanistan.

Wells suggested Russia "should unequivocally support the Afghan government," if it wants to end the conflict in Afghanistan, a thinly veiled reference to allegations of Russian support for the Taliban.

The linchpin in Washington's Afghan strategy is to put pressure on Pakistan to close safe havens used by Taliban fighters, most notably the Haqqani network, blamed for the more brazen and deadly attacks on Kabul.

To that end Lisa Curtis, senior director for South and Central Asia on the U.S. National Security Council, quietly conducted a series of meetings in the Pakistan capital on Monday, before leaving early Tuesday.

In the meetings, Curtis pressed Pakistan to put an end to the "Haqqani network and other terrorist groups" she said were operating on its territory, according to a statement issued by the U.S. Embassy.

Pakistan denies organized camps exist on its territory, though it says insurgents move throughout the country among the Afghan refugee population of 1.5 million. Pakistan also assails Afghanistan for allowing anti-Pakistan militants to have territory from which they plot and carry out attacks against Pakistan.

According to the U.S. Embassy, Curtis said "the United States seeks to move toward a new relationship with Pakistan" but she made it clear that won't happen until Pakistan moves on the Haqqani network and other militants.

Despite closer ties with Russia and a heavily invested China, for Pakistan even a bad relationship with the U.S. is better than no relationship at all, said Andrew Wilder, Asia programs vice president at the U.S. Institute of Peace.

"Pakistan losing the U.S. as a strategic partner due to Pakistan's Afghanistan policy, and ending up having to rely solely on China, is not a foreign policy success story for Pakistan - it's a major foreign policy failure," he said. "Pakistan's relationship with the U.S., even in its current weakened state, is still far more important in economic, diplomatic and security terms for Pakistan than its relationship with Russia."

Russia's honorary consul to Pakistan's Khyber Pukhtunkhwa Province, Mohammad Arsallah Khan. (AP Photo/Anjum Naveed)

Although Pakistan was not mentioned in the final communique that followed last week's Financial Action Task Force on terror funding, a motion by Washington to have Pakistan put on a global watch list prompted the task force to demand that Islamabad prove it is doing enough to curb terror financing by the time they meet again in June. Most analysts said the deadline was an indication that even its deep friendship with China was not enough to counter U.S. pressure.

Curtis called U.S. concerns about terror financing as well as money laundering in Pakistan "long-standing", and urged Pakistan to address what she termed "ongoing deficiencies."

Meanwhile, Chinese foreign ministry spokesman Lu Kang told a press conference on Tuesday that Beijing appreciates Islamabad's efforts to crack down on terror groups and intends to "continue to step up communication, coordination and collaboration with Pakistan in terms of counter-terrorism" co-operation.

"We have been calling on the international community to objectively and fairly view and evaluate Pakistan's efforts in fighting terrorism, and not keep criticizing the Pakistani side with prejudice," he said.

Still Michael Kugelman, Asia Program deputy director at the U.S.-based Wilson Center, warned against overstating the support for Pakistan of both China and Russia.

"We shouldn't overstate how much Beijing and Moscow can compensate for U.S. aid cuts and sanctions," said Kugelman. "China is not a charity and does not provide assistance on demand; it only provides support — including to key allies like Pakistan — when it serves its interests. Additionally, the extent of Russian support for Pakistan to this point is unclear."

___

Associated Press writers Matthew Pennington in Washington, Nataliya Vasilyeva in Moscow and Christopher Bodeen in Beijing contributed to this report.