Pakistani soldiers (R) patrol on a street next to welcoming posters of Saudi Arabian Crown Prince Mohammed bin Salman in Islamabad on February 17, 2019. AAMIR QURESHI | AFP | Getty Images

Pakistan risks becoming the latest arena for Saudi Arabia and Iran's rivalry as it accepts billions of dollars in aid and investment from Riyadh. 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."

Pakistani senators gifted the gold-plated gun, a German-made Heckler & Koch MP5, to Saudi Crown Prince Mohammed bin Salman during his visit to Pakistan. Handout | Senate of Pakistan

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.

I don't think the Pakistanis want to declare Iran an enemy and have a full-on confrontation... but they have to do something for that Saudi money. Gregory Gause International Affairs Department head, Texas A&M University

"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.

Helping Pakistan: What's in it for the Saudis?

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.

Prime Minister of Pakistan Imran Khan (R) meets Crown Prince of Saudi Arabia Mohammad bin Salman (L) in Islamabad, Pakistan on February 17, 2019. PRIME MINISTRY OF PAKISTAN | HANDOUT | Anadolu Agency | Getty Images

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.

… but it could backfire

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."

A new proxy battleground?