The 23-year-old has helped Rob Penney's side to sixth in the RaboDirect PRO12 standings, and has already notched nine Test appearances for Ireland.
And the versatile forward was over the moon to have extended his stay at his native region, while Munster boss Penney was ecstatic to have prolonged his stay at the club.
"I am delighted to have my future sorted and to commit to Munster," said Cork-born O'Mahony.
"It has been a really enjoyable journey so far for me and the last two seasons in particular have been exciting - from breaking into the Munster team and captaining the side and then earning my first cap for Ireland.
"I'm thoroughly enjoying my rugby at the moment and feel there is much more we can achieve with Munster and Ireland over the next couple of years and I wanted very much to be a part of that."
Munster coach Penney said: "We are delighted that Peter has agreed terms with the IRFU that keeps him here in Munster for the next two seasons.
"He represents the new breed of player, the next generation if you like, that are so critical to Irish rugby.
"To have him committing to the Munster organisation is a huge validation of what we are trying to achieve here.
"It is particularly encouraging that a young man of such ability and talent has the belief that his ambition is best served by the structures that we have in place here.
"So in that regard this news is massive. It's great for Munster and for Ireland too."