But since the Sept. 14 missile attacks on state-controlled oil giant Saudi Aramco — for which Washington and Riyadh blame Iran, while Iran denies responsibility — high-level exchanges between Pakistani and Iranian authorities have turned into mediation efforts that have wide-ranging impact and embrace the interests of the entire region. Though no breakthrough or solid result of this peace initiative is apparent yet, further escalation in the Gulf has been avoided so far and the situation in Yemen seems to be winding down.

When Khan visited Iran early this year, it was to solve bilateral issues, rebuild trust and bring an end to the ongoing terror attacks carried out from both sides of the Pakistan-Iran border.

Within just one year, the direction and focus of Pakistan-Iran ties has completely changed.

Since Pakistani Prime Minister Imran Khan assumed office in August 2018, there has been special focus on renewing trust and upgrading relations with close allies. Furthering Khan's peace efforts in the region, Bajwa is also pursuing military diplomacy and this was his second visit this year to Iran.

After arriving in Tehran earlier this month, Pakistan's army chief, Gen. Qamar Javed Bajwa, met with the Iranian civil and military hierarchy to extend the scope of bilateral relations and consolidate security arrangements.

Undoubtedly, Riyadh has remained overly discreet about the mediation and it takes two sides to clinch a deal, but there appears to be no current friction and an uneasy calm prevails.

Peace initiatives usually go through a gradual process, and Bajwa’s visit could help surmount hurdles. He has been improving military-to-military ties, reaching out to various regional powers lately to enhance trust, improve engagement and overcome challenges together.

Preferring defense diplomacy to public appearances, Bajwa likes to work on core objectives himself for the sake of clarity. Under this proactive strategy, he has been paying frequent visits to Saudi Arabia, the United Arab Emirates and Qatar, among other states.

Bajwa headed a high-ranking military delegation, including some top Pakistani intelligence officials, to meet with Iranian President Hassan Rouhani, Foreign Minister Mohammad Javad Zarif, Chief of Staff Mohammad Bagheri and Army commander Maj.-Gen. Abdolrahim Mousavi. Offering a solution-oriented approach, his efforts were well-received in Iran and several important factors are highlighted here.

First, having called for "military and defense cooperation with Iran," the general maintained the crucial balance between Riyadh and Tehran. Continuing Pakistan’s time-tested policy of remaining impartial in regional conflicts, a joint Pakistan-Iran security mechanism has been discussed and past issues seem to be forgotten.

Notably, Rouhani has “appreciated the role of Pakistan toward regional peace and successes of Pakistan's army against terrorism," according to the Pakistan Armed Forces Inter-Services Public Relations. Covering some important ground, the top officials discussed border issues, defense cooperation, counterterrorism and ways to combat sectarianism.

As a friendly gesture, Rouhani also said, “Tehran is ready to finish work on a gas pipeline that has been laid up to the Pakistan border.”

Second, in recent years, relations between Pakistan and Iran had become strained due to the cross-border terror attacks. Notwithstanding the previous negativity between Iran and Pakistan, there is now an improved understanding and Iran seems pleased with border security. The last such incident was an attack on 14 Pakistani naval personnel in Ormara, Pakistan, in April. Even Islamic Revolutionary Guard Corps commander Maj.-Gen. Hossein Salami has praised Pakistan for helping to reduce regional tensions. In February, 27 IRGC members had lost their lives in a cross-border attack.

Both countries' militaries took steps earlier this year to coordinate their policies regarding the Afghan Taliban and combating the Islamic State. Therefore, the current talks addressed the modalities of the Afghan peace process, as well as curbing the drug trade.

Encouraging closer ties, Mousavi proposed military student exchanges, while Bajwa emphasized the need for interaction to fight terrorism.

Third, Bajwa’s trip to Tehran could facilitate a rapprochement between Iran and Saudi Arabia. Ostensibly, his visit could further and put final touches on the mediation process.

Since fallout from the Gulf crisis can affect the economic security of the whole region, Iran and Saudi Arabia could work out their differences, and it's possible Bajwa’s proactive military diplomacy and Khan’s pacifist efforts will make some headway.

In the meantime, Tehran is occupied with internal issues. Iran has been wracked by protests since Nov. 15 due to reductions in the fuel subsidy; the government even shut off the internet for days, trying to curtail widespread dissent.

Nevertheless, Iranian state media covered the visit by referring to Pakistan and Iran as “friendly and brotherly countries” that have been victims of a "regional plot" to sow divisiveness, and reported the expected expansion of defense cooperation. Also giving favorable coverage to the general’s visit, and quoting Rouhani, Press TV in Tehran reported there have been positive developments toward enhancing border security and dealing with subversive activities in border areas.

Over the years, Tehran and Islamabad have faced hurdles in strengthening bilateral relations due to the baggage from alignments in regional and even global politics. As this year ends, their ties are on a more positive trajectory with some effective confidence-building measures, closer defense ties and an end to the recent distrust and acrimony.