Brazil winger Vinicius Jr has agreed a new six-year contract with Real Madrid that will keep him at the Bernabeu until 2032.
The 26-year-old had entered the final 12 months of his contract and attracted interest from Arsenal in recent weeks.
However, Real Madrid announced on Thursday the two parties have agreed to extend his deal to 30 June 2032.
"Vinicius Jr has become one of the most important players in one of the most successful periods in our history," said the club in a statement.
Talks over a deal were at an impasse until Real made a new offer on Wednesday, with Vinicius understood to be appreciative of the fresh terms.
He joined Real from Brazilian side Flamengo in 2018 and signed a contract extension three years ago.
Real and his representatives have been in talks over a fresh deal for the past 18 months but he is now set to extend his stay at what he has previously called the club of his "dreams".
He returned to the club on Monday for his first pre-season training session and medical assessment following his World Cup campaign with Brazil.
Vinicius has scored 128 goals in 375 appearances for Real across all competitions, while he has 13 goals in 54 caps for Brazil.
Related topics
Follow your club with BBC Sport
Listen to the latest Football Daily podcast
Get football news sent straight to your phone