The Portuguese superstar inked his new contract in the Royal Box at the Bernabeu at 12.45pm BST, with president Florentino Perez in attendance.
Ronaldo joined Madrid for a then world record fee of £80 million in 2009 and has scored a quite remarkable 203 goals in 203 games for the Spanish giants, including a strike in a 2-2 draw against Villarreal on Saturday night.
It is reported Ronaldo's new contract, worth £76m over five years, will make him the world's highest paid player - above Paris Saint-Germain's Zlatan Ibrahimovic.
The forward, 28, caused alarm in Madrid last season when speaking openly of his unhappiness at the club, but a huge new contract ends speculation that he could be set for a return to Manchester United.
He told a press conference after signing his contract: "I'm really happy here. I'll be here five more years. I just want to win trophies for this club. I appreciate the fans like me a lot to be here. I'm happy, I want to give my best on the pitch.
"I will be honest with you - everyone knows I was in Manchester for six years. Manchester is in the past. Now my club is Real Madrid. This is my home, my family is here and I'm really happy here.
"I respect all the clubs who ask about me. But they always know that my decision, that my only goal is to be here and to play at this club until, maybe, the end of my career. The future nobody knows."
Ronaldo has won the Liga title in 2012 and the Copa del Rey in 2011 since joining the Spanish club.
“I want to thank the press for being here,” he added. “I want to thank my team-mates, my coach and finally the president for agreeing a deal that makes me extremely happy.
“For me it's a privilege to continue here. It's like it was my first day. I'm going to continue with the same spirit of self-sacrifice and I'll do everything for the shirt.
“For me it's a special day and I'm very grateful, especially to the president and to the fans who have supported me. There are the reason why I'm staying here, at my home, maybe through to the end of my career.
“For me this club is the best, I'm really, really happy".