The surprise visit may have been intended to shore up various aspects of the Saudi-Pakistani defense relationship, perhaps including their suspected arrangement regarding access to nuclear weapons.

On August 28, Saudi deputy crown prince Muhammad bin Salman (aka MbS) made an unexpected three-hour stopover in Islamabad on his way to China and Japan. The Asia trip by King Salman's favorite son has been heralded as an effort to boost economic ties with two major importers of Saudi oil. MbS, the architect of the "Vision 2030" plan to develop the Saudi economy, will also be representing his country at the G-20 economic summit in Hangzhou, China, on September 4-5. Pakistan is not an obvious fit in this itinerary; India would have been a more logical stop if the discussions were business oriented. So it is legitimate to speculate on other reasons for the visit, and defense issues -- some of them potentially worrisome for Washington -- are the most likely candidate.

According to the official Saudi Press Agency, the talks between MbS and Prime Minister Nawaz Sharif also included Pakistan's defense minister and army chief, with an agenda focusing on "bilateral relations" and "the ways to further develop them in various fields." Although these "fields" were not specified, MbS -- who is also the kingdom's defense minister -- was quoted as saying the visit "underlined the depth of the strategic relationship between the two peoples."

One aspect of the strategic relationship on which Riyadh has sought greater Pakistani buy-in is the ongoing Gulf intervention in Yemen, and the matter may have come up again given the ongoing stalemate in the kingdom's proxy conflict with Iran. Islamabad has so far refused to send ground troops there. Pakistani officials were similarly reluctant when Riyadh sought to draft them into a so-called regional "antiterrorism coalition" in recent months.

At the same time, Pakistan has vocally supported the latter initiative, in addition to signing an as-yet-undetailed bilateral military cooperation agreement in January and pledging to take action if the kingdom's territorial integrity were threatened. In this context, the oft-mentioned but never publicly confirmed nuclear arrangement between the two countries -- under which Saudi Arabia might be able to borrow Pakistani nuclear weapons in a time of crisis -- may once again have come to the fore during the latest visit.

Along with Libya, Saudi Arabia is judged to have been an early financial backer of Pakistan's nuclear weapons development beginning in the 1970s. And in 1999, the late defense minister Prince Sultan visited the Pakistani uranium enrichment plant at Kahuta as a guest of Sharif, who was prime minister then as well. If Pakistan did in fact agree to position nuclear-tipped missiles in Saudi Arabia in the event of an emergency or otherwise provide a nuclear deterrent against Iran, this would likely be a nebulous verbal arrangement rather than a formal written pact -- hence the need for periodic high-level visits to reconfirm the understanding. MbS visited Pakistan this January, while Sharif has traveled to the kingdom several times this year, in some cases with his army chief in tow, providing ample opportunity to discuss the issue.

It also bears mentioning that Sharif's recent health and family issues -- namely, his major heart surgery in May and revelations that some of his relatives held suspect bank accounts in the "Panama Papers" scandal -- could cause him to resign. Pakistan's nuclear arsenal is notionally under civilian control, though the military has actual custody of the weapons and a crucial say in policy.

More broadly, Riyadh's pursuit of enhanced defense cooperation and perhaps even nuclear options with Pakistan should be viewed in the context of Saudi Arabia's continued role as the leader of the Islamic world, a leading Arab state, and a crucial player in global energy markets. The kingdom is the only Arab member of the G-20 forum, and the fact that MbS, who is just turning thirty-one, is leading the delegation to the Hangzhou summit reflects his position as Riyadh's new international face, rather than older, ailing royals such as King Salman or Crown Prince Muhammad bin Nayef. MbS is believed to be especially concerned about the threat posed by Iran, so having a nuclear-armed defense partner in his corner -- and possible access to nuclear weapons themselves -- makes sense from his perspective, even if Washington disagrees.

Simon Henderson is the Baker Fellow and director of the Gulf and Energy Policy Program at The Washington Institute.