Pakistan and Saudi Arabia have long cultivated what both Sunni Muslim countries call a "fraternal" relationship.
But the long-standing economic, political, and military ties between the South Asian state and the oil-rich Middle East kingdom have been based less on common values and more on transactions, experts say.
Riyadh has provided huge financial support in the form of cheap oil and loans to Islamabad, which has been reeling for years from a struggling economy and energy crisis.
As the custodian of the two holiest sites in Islam, Saudi Arabia has given legitimacy to Pakistan's political and military elite, which has promoted a conservative Islamic identity in the country.
Riyadh also allegedly helped fund Pakistan's nuclear weapons program in the 1970s.
In return, Pakistan has sent its forces to help defend the kingdom over the decades.
Islamabad has also cooperated closely with Saudi Arabia to curb the expanding influence in the region of Iran -- Pakistan's western neighbor and Riyadh's mortal foe.
The Saudis have also been allowed to spread their extremist Wahhabi version of Islam in Pakistan through a vast network of mosques and seminaries.
But those close ties seem to have hit rock-bottom as the relationship has hit major snags.
'Stand With Us'
In unprecedentedly blunt comments, Pakistani Foreign Minister Shah Mahmood Qureshi lashed out at Saudi Arabia for its perceived lack of support for Islamabad's interests in the disputed Kashmir region.
The Muslim-majority Himalayan region is divided between Pakistan and archrival India but claimed by both in its entirety. The two countries have fought three wars over the region.
Qureshi said on August 5 that Islamabad expected the Organization of the Islamic Conference (OIC) -- a group of 57 Muslim countries from Africa, the Middle East, and Asia that is based in Saudi Arabia -- to convene a meeting on Kashmir.
Otherwise, he said, Pakistan would be "compelled" to "call a meeting of the Islamic countries that are ready to stand with us on the issue of Kashmir," which has been viewed as a threat to create a new bloc that would rival the Saudi-dominated OIC.
The foreign minister mentioned Iran, Turkey, and Qatar, Riyadh's regional rivals with which Pakistan has bolstered ties in recent years.
Qureshi said Pakistan last year pulled out of an international summit for leaders of Muslim countries in Malaysia because of Riyadh's concerns that the meeting could undermine the OIC.
But now, he said, Pakistan was demanding Riyadh "show leadership on the issue" of Kashmir. "We have our own sensitivities," he said. "Gulf countries should understand this. I'm taking a position despite our good ties with Saudi Arabia. We cannot stay silent anymore on the sufferings of the Kashmiris."
Qureshi's comments came on the first anniversary of India's decision to revoke the special status of territory under its administration in Kashmir, a move that outraged Pakistan.
Pakistan's Foreign Office on August 6 defended Qureshi's rare public criticism of Riyadh, saying the minister's remarks reflected the "people's aspirations and expectations."
Game Of Loans
The same day, media reports in Pakistan said the government was forced to repay $1 billion of a $3 billion loan it had secured from Saudi Arabia.
Those loans were part of a $6.2 billion package announced by Saudi Arabia in October 2018, which included a total of $3 billion in loans and a further $3.2 billion loan for oil imports.
Media reports also said Pakistan had not received any oil under the deal since May.
In February, Saudi Crown Prince Muhammad bin Salman signed investment deals with Pakistan worth $20 billion, including for a $10 billion refinery and petrochemicals complex in the port city of Gwadar.
Pakistani Prime Minister Imran Khan was criticized and even mocked on social media for chauffeuring for the crown prince upon his arrival in Islamabad, a move intended to portray the kingdom's importance to Pakistan.
On August 10 -- just days after Qureshi's outburst, the Saudi ambassador in Islamabad met with Pakistan's chief of army staff, General Qamar Javed Bajwa. The military holds an oversized role in the country's domestic and foreign affairs.
A Pakistani government statement said that "matters of mutual interest, the regional security situation, and bilateral defense relations between the two brotherly countries were discussed during the meeting."
"The Saudis have stood by Pakistan in times of need," says Husain Haqqani, Pakistan's former ambassador to the United States and a director at the Washington-based Hudson Institute. "But Riyadh feels Pakistan is less forthcoming in supporting Saudi Arabia on its security concerns while demanding both economic assistance and political support."
Pakistan failed to send troops to help a Saudi-led coalition that has been fighting Huthi rebels in Yemen since 2015.
Meanwhile, Islamabad is wary of the burgeoning economic ties between Riyadh and New Delhi. Saudi Arabia has become India's fourth-largest trading partner and the main source of its oil imports, with bilateral trade at $27 billion annually.
In comparison, Pakistan's bilateral trade with Saudi Arabia stands at just $3.6 billion.
"The Saudis look at Pakistan as an ungrateful recipient of their assistance, including direct budget support, oil supplied on a deferred-payment basis, and several hundred thousand jobs for unskilled workers," Haqqani says. "But for the Saudis, India is a major trading partner and they are refusing to play Islamabad's zero-sum game on India."
In recent years, Saudi Arabia has expelled thousands of Pakistanis for not possessing valid legal documents, although some observers say the expulsions are the consequences of worsening diplomatic relations.
Saudi Arabia remains the main source of Pakistan's remittances. Overseas Pakistani workers sent nearly $19 billion home between July 2019 and April 2020, with $4.4 billion remitted from Saudi Arabia alone, according to the State Bank of Pakistan.
Mosharraf Zaidi, a Pakistani columnist and former diplomat, says the diplomatic row will have "implications" for Islamabad, adding that the government has made "a habit of making bombastic statements about the closest strategic partners of the country."
"Saudi Arabia is not a casual partner of the country," Zaidi says.
Najam Sethi, a prominent Pakistani journalist, wrote in a column that Pakistani-Saudi ties had "hit rock-bottom already" and Qureshi's "outburst is a consequence of this fact rather than a cause of it."
Imtiaz Gul, head of the independent Center for Research and Security Studies in Islamabad, says the spat with Riyadh is an "expression of frustration with the lack of Saudi support on Kashmir and its close economic relations with India."
But he says it does not signal a strategic realignment by Islamabad, which has forged warmer ties recently with Iran. "Pakistan will largely remain aligned with Saudi Arabia and the other OIC countries, including Turkey," Gul says. "The relationship with Iran has been tricky and very wobbly from the very beginning. And I don't expect it to reach to the level of our relationship with Turkey or Saudi Arabia."
Pakistani opposition parties and political commentators have slammed the government for its public criticism of Riyadh, arguing that Islamabad cannot afford to alienate its Saudi benefactors.
Khurram Dastagir, a former defense minister and central leader of the opposition Pakistan Muslim League-Nawaz (PML-N) party of ousted Prime Minister Nawaz Sharif, said Qureshi's remarks were "most unfortunate and ill-advised" because "we have a long-standing relationship with Saudi Arabia."
Dastagir said that "if there are differences, they should not be expressed in the unfortunate manner as said by the foreign minister."
Farhatullah Babar, a former senator and central leader of the Pakistan Peoples Party (PPP), told RFE/RL that Qureshi's statement was "irresponsible, thoughtless, and undiplomatic."