Cristiano Ronaldo pens record mega deal to stay at Real Madrid until 2021
Ronaldo's deal will take him to the age of 36 and will extend his stay at the Bernabeu to 12 years if he sees out the full term.
He joins Wales forward Gareth Bale in agreeing a new deal with the club, but he says it may not be the final contract he signs.
"I would like to thank the Real Madrid president, the club, my teammates, those who have helped me reach this stage," he said at a club event to confirm the deal.
"It's a very important day. I have said many times that I carry this club in my heart, it's part of me.
"In a very special moment of time in my life, I'm going to be here for another five years. It's not going to be my last contract, let it be known, but it's very special.
"My thoughts are I want to continue being the best. I want to wear this shirt with pride and I'm sure I'm going to continue contributing the same over the next five years as I have been, scoring goals and winning titles.
"I have to wait and see [about the date of my retirement]. Who knows what the future holds?
"Of course, I would like to end my career at this club. This is my penultimate contract. I want to be here for many years to come. I'm overjoyed."
Ronaldo has enjoyed an excellent 2016, winning European titles at both club and international level.
The Champions League title was his second with Madrid, to add to one La Liga crown, two Copa del Rey trophies, the Supercopa de Espana, UEFA Super Cup and Club World Cup.
Madrid president Florentino Perez admitted he was delighted to secure Ronaldo's services for the foreseeable future.
"You are a living legend at this club – the highest scorer in the club's history," he said to Ronaldo.
"You are unique, one of a kind. You scored over 50 goals in each of your last six seasons, looking at your successes last year you deserve to win the Ballon d'Or [for the world’s best player].
"It's a special day for Real Madrid. You never tire, you always want more and will be part of this club for many years to come.
"Cristiano, we share the same ambition, desire. You have agreed to sign a deal that will see you stay here until 2021. We want to continue to build this legend, we want to be together for many years to come."
Ronaldo has scored 371 goals in 360 appearances for Real since his move from Manchester United in 2009.