The contract will see the right-back remain at the Santiago Bernabeu until the end of the 2021-22 season.
A product of the club’s academy, Carvajal re-joined Madrid for a reported €6.5 million at the beginning of the 2013-14 campaign after impressing in a lone season at Bundesliga side Bayer Leverkusen.
The 25-year-old has been a regular presence under Zinedine Zidane and has gone on to win 13 caps for Spain since debuting in 2014.
Real Madrid 7/2 to win the Champions League
Carvajal follows fellow full-back Marcelo and star midfielder Isco in inking a new deal with Los Blancos.