Iran and Saudi Arabia, two Middle Eastern regional powers, are engaged in a battle over regional hegemony that is being waged between Shiite Iran and its allies and a Sunni Arab coalition led by Saudi Arabia at a number of friction points across the Middle East and East Africa including Yemen and Somalia. Saudi Arabia sees Iran as the paramount threat to the Middle East's stability because of its support for militias that Riyadh says have inflamed sectarian violence in the region.
The animosity between Iran and Al-Qaeda is public and abundantly clear. For Al-Qaeda and its allies such as Al Shabaab, Shi`a are not true Muslims and should be treated as outcasts at best, if not apostates. For Iran, Al-Qaeda and Al Shabaab are bigots who abuse Shi`a.  But despite their ideological and religious differences, Iran and al-Qaeda have succeeded in ignoring the Shiite-Sunni conflict in order to concentrate on the fight against the common enemies.
In recent years, there have been increasing signs that Iran and Al-Qaeda's east African branch - Al Shabaab in Somalia have been growing closer. For Iran, working with non-State actors such as Al-Shabaab and the Houthis in Yemen is an essential part of its strategy, aimed at expanding its geopolitical influence throughout the region.
 Bruce Riedel, “The Mysterious Relationship Between Al-Qa`ida and Iran,” Combating Terrorism Center at West Point, July 2010, Volume 3, issue 7.
 Mareike Transfeld, “Iran’s Small Hand in Yemen”, Carnegie Endowment for International Peace, 14 February 2017.