Saudi Arabia has drawn two of the Muslim world’s most formidable military powers into its defense as the Iran war moves closer to the kingdom.

Pakistan and Turkey signed a NATO-style mutual defense pact with Saudi Arabia in Mecca on Friday, consolidating their longstanding security ties into a collective-defense alliance that stipulates an attack against any of them “shall be regarded as attack on them all.”

That commitment could draw Pakistan and Turkey into a war they have carefully kept at arm’s length.

The official rationale for the agreement is “to strengthen collective deterrence against any act of aggression” and further provide “for the enhancement of all aspects of defence cooperation among the three states,” according to a statement released by all three countries.

More specifically, the pact gives Saudi Arabia a powerful new layer of protection beyond its longstanding security partnership with the United States amid growing regional doubts over whether Washington can still be relied upon to protect its oil-rich Gulf allies.