BEIRUT, Lebanon — As Muslims from around the world head toward Mecca for the annual hajj pilgrimage, Saudi Arabia and Iran have escalated their sectarian rivalry over which country represents the true Islam.

Iran unleashed the first barb Monday, when the country’s supreme leader, Ayatollah Ali Khamenei, accused Saudi Arabia of deliberately killing pilgrims during last year’s hajj. He called for the world’s Muslims to reconsider Saudi control of the holy sites.

Saudi Arabia answered back on Tuesday, when the kingdom’s top cleric said that Iran’s leaders “are not Muslims.”

The spat underlines the deep religious and strategic rivalry between Shiite-led Iran and the Sunni royal family of Saudi Arabia that has put the two Middle Eastern powers on opposite sides of the wars in Yemen and Syria, and has them competing to undermine each other’s influence in the region.