The Foxes dominated proceedings in the opening stages of the game and took the lead in the 25th minute via an own goal.
Swansea found themselves further behind four minutes into the second half as Jamie Vardy's chipped ball to the far post picked out the unmarked Mahrez.
The Algerian was deemed to be onside as he cut the ball back into the box, where Shinji Okazaki was on hand to prod home from three yards out.
The centre-back did well to swivel towards goal before rifling beyond Kasper Schmeichel into the far corner of the net for his first league goal of the season.
Following their goal, Swansea continued to commit men forward in a bid to find an equaliser, but Schmeichel was never truly tested, the opposition mostly limited to long-range efforts.
Leicester had to remain firm at the back in the latter stages of the game, repelling wave after wave of attacks, but were able to hold on for only their second win of the season and first on the road.