The Saudi side announced on Saturday that his contract, which had been due to run until 2027, had been terminated.
The departure comes as a surprise, arriving shortly after Algeria's exit in the round of 32 at the World Cup and Mahrez's own announcement that he was retiring from international football.
The decision has caused some controversy among supporters, many of whom had hoped the Algerian forward would see out the final year of his deal.
Mahrez, who was named African Footballer of the Year in 2016, leaves Al Ahli having made 122 appearances, contributing 37 goals and 46 assists.
He also helped the club lift back-to-back AFC Champions League titles during his time in Saudi Arabia.
The 35-year-old's career took off at Leicester City, where he inspired the Foxes to a stunning Premier League title in 2015-16, before a move to Manchester City in 2018 saw him add four more league titles, an FA Cup, two League Cups and the Champions League to his collection, culminating in the club's continental treble in 2022-23.
He joined Al Ahli in July 2023, in a deal reportedly worth around ยฃ30million, and quickly became one of the leading figures in Saudi football, adding two AFC Champions League Elite titles and a Saudi Super Cup to an already decorated career.
Mahrez is now a free agent and, at 35, is expected to be assessing his options for what could prove the final contract of his career.
Al Ahli, meanwhile, are already understood to be searching for a new marquee signing to fill the void left by the Algerian's departure, as the club looks to maintain its standing among the leading forces in Saudi football.
