As USinfo-icon influence in Islamabad wanes, former adversary Moscowinfo-icon is building military, diplomatic and economic ties that could upend historic alliances in the region and open up a fast-growing gas marketinfo-icon for Russiainfo-icon's energy companies.

Russia's embrace of Pakistaninfo-icon comes at a time when relations between the United Statesinfo-icon and its historical ally are unravelling over the warinfo-icon in Afghanistaninfo-icon, a remarkable turnaround from the 1980s.

Though the Moscow-Islamabad rapprochement is in its infancy, and it is Chinainfo-icon that is filling the growing void left by the United States in Pakistan, a slew of energy deals and growing military cooperation promise to spark life into the Russia-Pakistan relationship that was dead for many decades.

"It is an opening," Defence Minister Khurram Dastgir Khan said in an interviewinfo-icon. "Both countries have to work through the past to open the door to the future."

The cosier diplomatic ties have so far focused on Afghanistan, where Russia has cultivated ties to the Afghan Taliban militants who are fighting US troops and have historic links to Islamabad. Moscow says it is encouraging peace negotiations.

Both Russia and Pakistan are also alarmed by the presence of militant Islamic Stateinfo-icon (IS) inside Afghanistan, with Moscow concerned the group's fighters could spread towards Central Asiainfo-icon and closer to home.

In Pakistan, IS has already carried out major attacks.

"We have common ground on most issues at diplomatic levels," Prime Minister Shahid Khaqan Abbasi told Reuters. "It's a relationship that will grow substantially in the future." During a trip to Moscow last month by Foreign Minister Khawaja Asif, the two countries announced plans to establish a commission on military cooperation to combat the threat of IS in the region.

They also agreed to continue annual military training exercises that began in 2016 and followed the sale of four Russian attack helicopters to Pakistan, as well as the purchase of Russian engines for the Pakistan Air Force's JF-17 fighter jets that Pakistan assembles.

The detente has been watched with suspicion by Indiainfo-icon, which broadly stood in the Soviet camp during the Cold War era. In the last two decades, the close Russia-India relationship has been underpinned by huge arms sales by Moscow to a country it calls a "strategic partner".

"If the Russians start backing the Pakistanis in a big way at the political level, then it creates a problem for us," said Sushant Sareen, a leading expert on India's relations to Pakistan and Afghanistan with New Delhiinfo-icon-based Observer Researchinfo-icon Foundation.

Pivoting east

Russian overtures to Pakistan offer a badly needed diplomatic lifeline for the South Asian nation as it faces growing friction with Western powers over its alleged links to militants.

At US urging, and with backing from Britaininfo-icon, Franceinfo-icon and Germanyinfo-icon, a global financial watchdog, the Financial Action Task Force (FATF), last month decided to place Pakistan back on its watch list of countries with inadequate terrorist-financing controls, potentially hurting Pakistan's fragile economyinfo-icon.

The US move, which Islamabad angrily dismissed as an effort to "embarrass" Pakistan, followed Washington's announcement in January to suspend $2 billion in military assistance.

Khawaja Asif, the foreign minister, said his nation made a historical error by "tilting 100 percent" to the West and was now eager to build alliances closer to home with the likes of China, Russia and Turkeyinfo-icon.

"We want to correct the imbalance of our foreign policyinfo-icon over 70 years," Asif told Reuters. "We are not divorcing that relationship (with the West). But we want to have a balance in our relationships, we want to be closer to our friends in our region."

Defence Minister Dastgir Khan said Pakistan's military, which has historically been heavily reliant on US weaponsinfo-icon and aircraft, may have no choice but to ramp up purchases from the likes of Russia.

The cooling relationship with Washington is already pushing Islamabad closer to China, which is investing about $60 billion in infrastructure in Pakistan. But analysts say Pakistan is wary of becoming overly dependent diplomatically on Beijing.

Pakistan is among several nations that have been courted by Moscow after falling out with Washington, including the Philippinesinfo-icon and Qatarinfo-icon, but Russia's long-term aims for the Pakistan relationship are unclear, according to Petr Topychkanov, a senior researcher at the Stockholm International Peace Research Institute.

"It's not very transparent, even in Russia," he said. "There is no serious public debate, there is no detailed explanation to the Russian public about what Russia wants in Pakistan." Russia's foreign ministry did not immediately respond to a request for comment about Moscow's increasingly close relations with Pakistan.

Energy deals

Russia and Pakistan are negotiating potential energy deals worth in excess of $10 billion, according to Pakistani energy officials. Khawaja Asif said four to five huge power projects "will cement our relationship further".

Russia last month appointed an honorary counsel in Khyber Pukhtunkhwa, where its companies are in talks to build an oilinfo-icon refinery and a power station.

But the biggest deals focus on gas supply and infrastructure to Pakistan, one of the worldinfo-icon's fastest growing liquefied natural gas (LNG) import markets.

In October, Pakistan and Russia signed an inter-governmental agreement on energy, paving the way for Russian state giant Gazprom to enter negotiations to supply LNG to Pakistan.

The talks are expected to conclude within three months and Gazprom is considered "one of the front-runners" to clinch a long-term supply deal, according to the Pakistani official. There is also growing confidence that a gas pipeline due to be built by Russia, stretching 1,100 km from Lahore to Karachi, will go ahead.

US sanctions against Russian state conglomerate Rostec, as well as a dispute over North-South pipeline transport fees, have held up the $2 billion project since it was signed in 2015.

The North-South pipeline would be the biggest infrastructure deal by Russia since early 1970s, when Soviet engineers constructed the Pakistan Steel Mills.

A Russian company, according to the defence minister, is eying up a deal to take over the disused Soviet-built steel mills.