Saudi Arabia and Pakistan have signed a formal mutual defence pact, Pakistani state television said on Wednesday.
The enhanced defence ties come as Gulf Arab states grow increasingly wary about the reliability of the United States as their longstanding security guarantor.
Israel's attack on Qatar last week heightened those concerns.
"This agreement is a culmination of years of discussions. This is not a response to specific countries or specific events but an institutionalisation of longstanding and deep cooperation between our two countries," a senior Saudi official told Reuters when asked about its timing.
The pact could shift the strategic calculus in a complex region.
The senior Saudi official, who spoke on condition of anonymity, acknowledged the need to balance relations with Pakistan's rival, India, also a nuclear power.
"Our relationship with India is more robust than it has ever been. We will continue to grow this relationship and seek to contribute to regional peace in whichever way we can."
Asked whether Pakistan would be obliged to provide Saudi Arabia with a nuclear umbrella under the pact, the official said, "This is a comprehensive defensive agreement that encompasses all military means."
Pakistani state television showed Pakistani Prime Minister Shehbaz Sharif and Saudi Crown Prince Mohammed bin Salman embracing after signing the agreement.
In attendance was Pakistan's army chief, Field Marshal Asim Munir.
“This agreement, which reflects the shared commitment of both nations to enhance their security and to achieve security and peace in the region and the world,” a statement from the Pakistani prime minister's office said.
The agreement, called the Strategic Mutual Defence Agreement, was signed during Pakistan's Prime Minister Shehbaz Sharif's visit to Jeddah, where he met Saudi Crown Prince Mohammed bin Salman.
Under the new pact, Islamabad and Riyadh aim to develop joint deterrence.
“The agreement aims to develop aspects of defence cooperation between the two countries and strengthen joint deterrence against any aggression,” the Islamabad statement said.
“The agreement states that any aggression against either country shall be considered an aggression against both.”
