Vardy was bidding to score in his 12th consecutive league match but wasted a one-on-one against Lukasz Fabianski in the first half.
Still, Mahrez stole the show with three goals as Leicester took advantage of Manchester City’s defeat to Stoke City to move clear at the top.
The Foxes are now two points clear of Arsenal, who beat Sunderland 3-1, and three ahead of both City and Manchester United.
Dede Ayew played for 90 minutes.
The pre-match attention was inevitably focused on Leicester’s Jamie Vardy, who had set a Premier League record by scoring for an 11th successive game against Manchester United.
But the former Fleetwood striker had to settle for a supporting role as Mahrez took centre stage.
Both the Algerian’s first two goals were fortuitous, but they were no more than Claudio Ranieri’s side deserved for an utterly dominant first half.
Mahrez’s opening goal was a scrappy one, the ball flicked on from a corner and appeared to hit his head and arm before trickling over the line.
The 24-year-old’s second was a more conventional finish – confidently swept into the bottom corner – but he seemed to be offside from N’Golo Kante’s pass.
While Leicester’s delirious travelling fans sang about being top of the league, a sense of dread and agitation spread among the home supporters as Swansea were booed off at half-time.