"I wanted to announce that I have chosen to extend my contract at Paris Saint-Germain, and I am of course very happy. I am convinced that here I can continue to grow within a club that gives itself all the means to perform at the highest level," the 23-year-old said in a club statement.
"I am also very happy to be able to continue playing in France, the country where I was born, grew up and flourished."
Mbappe and club president Nasser Al Khelaifi posed holding a "Mbappe 2025" PSG shirt before the last game of the Ligue 1 season against Metz as the crowd erupted when Al Khelaifi broke the news at the Parc des Princes.
The France forward, whose current contract expires on June 30, had been widely tipped to join Real Madrid.
The 23-year-old, one of the game's finest talents who burst onto the scene as a teenager and helped France win the World Cup in 2018, was set to leave on a free transfer when his contract expired at the end of the season.
PSG signed Mbappe from AS Monaco in 2017 in a deal reported to be about 180 million euros, making him the world's second-most expensive signing after Neymar, who joined PSG from Barcelona for 222 million euros.
Real's bid to sign Mbappe last year was rejected by the Parisian club, who appeared prepared to lose him on a free transfer this year.
Reports last year claimed the Spanish champions had offered PSG as much as 200 million euros for the Frenchman.
PSG had no intention of selling their young talisman in their quest for Champions League glory, but the French club fell well short this season when Real staged a dramatic second-leg comeback in the last-16 to knock them out of the competition.
PSG had been reinforced last year with the signing of Lionel Messi from Barcelona to add firepower to a star-studded squad. But apart from reclaiming the Ligue 1 title, the French club failed to win any other trophies.
Mbappe, however, excelled individually, scoring 36 goals and providing 26 assists for PSG in all competitions this season.