Joshua King’s 35th-minute penalty gave the Cherries the lead before Mahrez fired in his ninth goal of the season in stoppage time to earn the Foxes a 1-1 draw.
The Algeria international dispatched a brilliant 25-yard free kick past Asmir Begovic in the 97th minute to salvage a point for the hosts.
“It was a very difficult game. We started good, but after the injury of [Daniel] Amartey, we changed our shape. It was difficult for us,” Mahrez told club website.
“The second half was better and we had a lot of chances, but we didn’t score, so I think in this type of game, when it’s close, you need a free kick or something difficult to do.
“I saw the ‘keeper was a little bit on the right and I took my chance. This goal I think is deserved. We deserved a point at least and I think it’s good for us to not lose today."
On Leicester's resilience, he continued: “That’s our team. We have always been like that. We knew we were going to score and until the end, we never gave up.
“We scored and everyone was happy. It’s better to win, but when you look at the game and you go after the goal, you take the draw.”
Leicester City sit in the eighth spot in the Premier League table with 37 points from 29 games. They visit bottom-placed West Bromwich Albion for their next league outing on March 10.