ISLAMABAD - Pakistan has wrapped up a groundbreaking contract with Russia that would, for the first time, open doors for Russian military training of Pakistani army officers.

The rare deal comes amid deteriorating relations between Islamabad and the United States, which has resulted in the halt of all military exchange programs with Pakistan and left a void that Moscow has stepped in to fill.

The security training agreement concluded Tuesday at the end of the two-day inaugural meeting of the Russia-Pakistan Joint Military Consultative Committee (JMCC), said a Pakistan Defense Ministry statement.

Pakistani Defense Secretary Zamir ul Hassan Shah and visiting Russian Deputy Defense Minister Col. Gen. Alexander Fomin led their respective delegations at the talks in Rawalpindi, where the army is headquartered.

"The two sides also held in-depth discussions on avenues of future cooperation. At the end, both countries signed the Contract on Admission of Service Members of Pakistan in the RF [Russian Federation's] Training Institutes," said the ministry statement.

The Islamabad-Moscow security partnership has strengthened and expanded since late 2014, when the two former rivals signed their defense cooperation agreement.

FILE - A Russian military MI-35M helicopter perfor FILE - A Russian military MI-35M helicopter performs during an air show in Zhukovsky, outside Moscow, Aug. 23, 2007. Russia has sold the combat helicopters to Pakistan. FILE - A Russian military MI-35M helicopter performs during an air show in Zhukovsky, outside Moscow, Aug. 23, 2007. Russia has sold the combat helicopters to Pakistan.

Russia sold four Mi-35M combat helicopters to Pakistan under the deal, and both countries have since held two rounds of counterterrorism military drills on each other's soil.

Navies of the two countries also recently participated in joint antidrug exercises in the Arabian Sea. The latest naval collaboration took place last week in St. Petersburg, where a Pakistani warship participated in the major Russian Navy Day parade.

"It was a very important event for us. Actually, illustration of this importance is that this parade was taken by the commander-in-chief of Russian armed forces, President Mr. Putin," Russian ambassador to Pakistan, Alexey Dedov, said last week.

"This cooperation is developing into many directions. So, there is quite a wide spectrum. And, of course, this is a reflection of our approach to the relations with Pakistan, which to our country has their own independent value for us."

Pakistan-U.S. ties

Pakistan's relations with the U.S., meanwhile, have deteriorated since President Donald Trump took office and blamed Islamabad in his South Asia strategy for harboring terrorists and not doing enough to stop insurgent attacks in neighboring Afghanistan.

Trump suspended all military assistance to Pakistan in January until it takes decisive action against militants on its soil.

Pakistani leaders have rejected terrorism and other charges, saying they stem from U.S. security failures in Afghanistan. They also say that halting decades-old military diplomacy will fuel misunderstandings between the two countries.

"Training at Russian military institutes would bring about a major shift in the world view of top [Pakistan] military officers," noted Baqir Sajjad, an Islamabad-based journalist and defense analyst. "Until now, the brightest officers poised for leadership positions were trained in U.S."

Pakistan's Prime Minister-elect Imran Khan vowed Wednesday that his would-be government will work to improve relations with the U.S.

Pakistan Politics FILE - A Pakistani takes selfie with Imran Khan, center, head of the Pakistan Tehreek-e-Insaf party, as he leaves a party meeting in Islamabad, Pakistan, Aug. 6, 2018. FILE - A Pakistani takes selfie with Imran Khan, center, head of the Pakistan Tehreek-e-Insaf party, as he leaves a party meeting in Islamabad, Pakistan, Aug. 6, 2018.

"Pakistan and the United States have witnessed many ups and downs in their relationship, which were the outcome of a trust deficit between the two countries," Khan told acting American ambassador to Islamabad, John Hoover, who called the Pakistani leader to congratulate him on his election victory.

An official statement issued after the meeting said the prime minister-in-waiting said his government will engage with the U.S. to make the relationship more balanced and trustworthy. Khan called on the U.S. and the region in general to work collectively to find a political settlement to Afghanistan.

He also emphasized the "revitalization of diplomatic ties between the two countries and stressed the need to transform it for the benefit of both Pakistan and the United States."

Countering terrorism

While American leaders are skeptical and critical of Pakistan's counterterrorism efforts, Russian leaders praise Islamabad for eliminating terrorism from Pakistani soil.

"It [Pakistan] is a very, very important party, not only in the regional stability, the stability worldwide. It's our very valuable partner of tackling such challenges and threats as terrorism, illegal drug trafficking, etc. Our countries face similar challenges and threats to national security," said Russian ambassador Dedov, while speaking at a seminar in Islamabad.

Russia is determined, he said, to give "practical assistance" to strengthen Pakistan's counterterrorism efforts.

Russia and Pakistan both have openly expressed concerns over the emergence of Islamic State's Afghan branch, known as ISK-P, in "ungoverned spaces" of the war-shattered country.

Former Pakistani army general Yasin Malik said Afghanistan remains at the center of growing cooperation with Russia.

"This [Afghanistan] is a common denominator for both of us. And the presence of IS is a threat to both the Russian Federation and to Pakistan. Very serious efforts are there to jointly meet the challenge of IS in Afghanistan. I think that will be the hallmark of cooperation in security and military between Russia and Pakistan," Malik noted.

Aiding the Taliban?

There are also growing allegations that Moscow and Islamabad — under the pretext of fighting IS — are providing covert military support to the Taliban.

Russian ambassador to Pakistan Alexey Dedov, cente Russian ambassador to Pakistan Alexey Dedov, center, speaks at an Islamabad Policy Research Institute seminar in Islamabad. (Photo courtesy of IPRI) Russian ambassador to Pakistan Alexey Dedov, center, speaks at an Islamabad Policy Research Institute seminar in Islamabad. (Photo courtesy of IPRI)

Russia and Pakistan insist their ties with the Taliban are meant solely to encourage the insurgents to engage in peace talks with the Afghan government to help end the conflict and deter terrorists from using the country for international terrorism.

Dedov noted that last month, the chief of Russia's external intelligence agency also visited Pakistan to participate in a four-nation meeting, with Chinese and Iranian spymasters in attendance. The rare meeting, officials said, focused on the buildup of IS in turmoil-hit Afghanistan.

The Russian ambassador credited improved relations with Pakistan to regular exchanges of high-level civilian and military delegations between Pakistani and Russia. He noted that the volume of bilateral trade has increased by 82 percent in the first five months of 2018 and stood at $450 million. Moscow also is working to help Pakistan build an 1,100-kilometer gas pipeline linking Karachi to Lahore.

Dedov, while delivering last week's lecture at the Islamabad Policy Research Institute (IPRI), did not rule out nuclear cooperation with Pakistan for peaceful purposes, saying, "We do not see obstacles in this matter."