The 26-year-old Frenchman said his goodbyes in an emotional social media post on Saturday.
Saint-Maximin spent four years at Saint James' Park after joining from OGC Nice in the summer of 2019.
He made 124 appearances in total for the Magpies and scored 13 goals.
Saint-Maximin played his part as Newcastle finished fourth in the Premier League last season to qualify for the UEFA Champions League.
“Everyone at Newcastle United thanks Allan for his contribution to the club and community and extends best wishes for the next chapter in his career,” Newcastle said in a statement confirming his departure.
Saint-Maximin is joining former Premier League players Edouard Mendy, Roberto Firmino and Riyad Mahrez in the Al Ahli squad.
"We pick the best, and he's one of them," Al-Ahli posted on messaging platform X, previously known as Twitter.
Newcastle have already secured Saint-Maximin's replacement with the signing of Leicester City winger Harvey Barnes.