The Manchester City star was a constant threat in Cairo as Algeria started the tournament in impressive fashion.
Having not even made it out of their group in 2017, Algeria took a deserved 34th-minute lead when Baghdad Bounedjah converted from the penalty spot.
Mahrez doubled Algeria’s advantage just before half-time with a deflected effort and Djamel Belmadi’s men comfortably saw out the second half to seal the three points.
Algeria had a chance inside 60 seconds, Bounedjah shooting wide, and it set the tone for a one-sided first half.
The chances came at regular intervals for Algeria, Mahrez having a pair of free-kicks deflected off target, while Youcef Belaili went close on two occassions.
So it was no surprise when the opening goal came, with Dennis Odhiambo conceding a penalty for his foul on Youcef Atal and Boundejah calmly stroking the spot-kick past Patrick Matasi.
And, after Boundejah headed just over, Mahrez got his goal, turning in Ismael Bennacer’s cross from 12 yards with a cool left-footed strike.
The second half was a turgid affair full of fouls and stoppages, with only Mahrez’s moments of quality bringing life to the contest.