Perhaps one of the most visually memorable moments of Saudi Crown Prince Mohammed bin Salman's red carpet tour of Asia last month was the gifting to him, by Pakistani senators, of a gold-plated submachine gun. Pakistan, the crown prince's first stop on his tour that also included India and China, announced a national holiday in honor of his visit, calling Saudi Arabia "a friend in need."
And indeed, Islamabad is happy: Saudi Arabia announced $20 billion in infrastructure and energy investments for the cash-strapped country of 200 million, which is currently on the brink of financial crisis and trying to avoid its thirteenth International Monetary Fund bailout.
The location of the investments is significant. Many of the projects focus on oil refining infrastructure in Pakistan's impoverished and restive Balochistan region, which lies along the 565-mile border with Saudi arch-rival Iran.
"Mohammed bin Salman has this strategic view that you've got to pressure Iran. And with Pakistan, he'd love to be able to pressure Iran from two sides," Gregory Gause, head of the International Affairs Department at Texas A&M University, told CNBC.
That presents a hard choice for the Pakistanis, who currently neither see Iran as a major ally nor a major threat, though they are wary of Iran's increasing cooperation with their own arch-rival, India.
"I don't think the Pakistanis want to declare Iran an enemy and have a full-on confrontation," Gause said, "but they have to do something for that Saudi money."
And the Iranians aren't taking it lightly — Tehran has long accused Saudi Arabia of fomenting unrest in its border area with Pakistan, which is home to Iranian Sunni anti-regime militants who have launched numerous attacks on Iranian military personnel. The Saudis deny the accusations.
In February, Sunni militants from the extremist group Jaish al-Adl killed 27 Iranian Revolutionary Guards along the border, triggering the accusation from Tehran that Pakistan is housing militants and allowing them to attack Iran.
For Riyadh, the Pakistan deals are more strategic than economic, says Gause.
"There's just no economic benefit to Saudi in Pakistan," he said. "Let's face it — Pakistan is kind of a basket case. But for the Saudis, Pakistan is first and foremost a security partner, a reliable Muslim ally in intra-Muslim disputes."
Indeed, the two have a long history of helping each other out. When Pakistan was hit with international sanctions for its nuclear tests in the 1990s, Riyadh came to its rescue with oil supplies and funds. And there are some 70,000 Pakistani nationals serving across Saudi Arabia's armed forces, experts estimate, with more deployed in recent years to provide training and assistance to the Saudi military.
Pakistan's military is ranked as the world's 17th strongest, according to military analysis website GlobalFirepower.com, in between Israel and North Korea. Saudi Arabia's is ranked 25th.
There are also rumors that Pakistan, a nuclear power, could share its weapons technology with the Saudis, who have expressed their desire for a nuclear program with no restrictions on the uranium enrichment capabilities necessary for making a bomb.
While experts agree this sort of help is unlikely, "I think that the Saudis nurture hopes that if they need it either conventionally or in a nuclear sense, the Pakistanis will give them assistance," Gause said.
There are plenty of ways this could backfire on the Pakistanis. For one, Iran, which is Shia, could foment sectarian unrest within Pakistan's 20 percent Shia population, the second-largest of any country in the world. Thousands of Pakistanis have been killed in sectarian violence in the last decade.
Iran could also serve as a gateway for Indian spies to infiltrate Pakistan, something some in Pakistan have already accused it of doing.
"Iran is likely to be on Pakistan's mind, as there is a growing partnership between India and Iran," said Kamal Madishetty, a research analyst at the Economist Unit, pointing to India's multi-billion dollar Chabahar Port project in Iran's border region with Pakistan. "This has unsettled the leadership in Pakistan, so the relationship with Saudi is kind of a counterbalance to all of that."
Pakistan "to some extent already has" become a proxy theater for Iran and Saudi Arabia, Gause said, but he added that this was at a relatively low level — nothing like what we've seen in Syria, Yemen or Iraq, for instance. That's because Pakistan is a relatively stronger state that hasn't been crippled by war. Furthermore, it doesn't always do what the Saudis want: In 2015, the government in Islamabad passed a resolution ruling out sending troops to join the Saudi-led coalition in Yemen, despite pressure from Riyadh.
But there are indications that Pakistan will indirectly provide more support for the Saudi campaign in Yemen, despite the war's deep unpopularity among the Pakistani public.
Last year, when Pakistan sent an additional 1,000 troops to Saudi Arabia, the defense minister made public assurances that they wouldn't be participating in the Yemen War.
"But it's interesting," Madishetty observed, "the Pakistani army has developed significant expertise in mountain warfare and counterinsurgency, and they will be transferring these skills to Saudi forces."
The only mountainous region within Saudi Arabia that's currently a conflict zone? Its border with Yemen.