The win lifts them to second place in the group with only a fixture against Russia remaining. A win in that game would guarantee their progress to the second round, while a draw could also see them advance if South Korea fail to beat Belgium.
After becoming the first City player in 12 years to appear in a World Cup when he started the opening fixture against Belgium, Mahrez was named among the substitutes for Sunday’s game with South Korea – one of five changes to the XI.
Knowing that a defeat would end their World Cup hopes, the Desert Foxes raced out of the blocks with a dazzling display of first half football that saw them create a host of chances on their way to a 3-0 lead at the break.
Islam Slimani made the initial breakthrough when he ran onto a long ball to nudge a shot past the South Korean goalkeeper, and less than two minutes later former Fulham man Rafik Halliche headed them 2-0 up from a corner.
There was still time for Abdelmoumene Djabou to slide home a third, before the South Koreans rallied after the break with a drilled finish from Song Heung-min.
However Algeria’s Yacine Brahimi then added a fourth to re-establish a three-goal cushion just after the hour mark and make the game seemingly safe, meaning there was no need to call for Mahrez from the bench.
Koo Ja-cheol did snatch another goal from close range with 15 minutes left, but the excellent Algerian side had done enough with a performance that will have impressed many.
Despite Algeria’s first World Cup win since the 1982 tournament, Belgium remain hot favourites to go through as Group H winners, with the second placed team to face either Germany, Ghana, Portugal or the USA in the next round.
Mahrez and his team-mates will be back in action for their final group game against Russia on Thursday (26 June, 9pm BST).