Djamel Belmadi's side's task was made more difficult during the first half when Ramy Bensebaini was sent off for receiving two yellow cards across 24 first half minutes.
Despite Algeria having a man less, the two sides even contested the first 45' until Emil Forsberg struck in stoppage time.
The RB Leipzig forward stepped up from 12-yards and made no mistake from the penalty spot.
And Janne Andersson's side doubled their advantage two minutes after the interval when Coventry's Viktor Gyokeres assisted Viktor Claesson who fired home.
Mahrez's side still enjoyed possession with Sweden happy to sit off and protect their lead until the full-time whistle.
Our forward won't be in action for his country now until 13 January where he will face Libya.
And with Algeria not competing at the World Cup, the 31-year-old will enjoy a short break until City face Liverpool in the Carabao Cup on Thursday 22 December.