The Brazilian, 29, has won three Champions League and four La Liga titles in over 400 appearances since joining from Fluminense in 2006.
“Real Madrid and Marcelo have agreed to extend the contract of the player, who will remain tied to the club until June 30, 2022,” the club said.
Marcelo will, though, be suspended for Madrid’s next two La Liga games after his ban for being sent off for a kick at Jefferson Lerma in Saturday’s 1-1 draw at home to Levante was also confirmed on Wednesday.
The left-back will be absent for Sunday’s trip to Real Sociedad and the visit of Real Betis on September 20.
Real will seek to put a disappointing start to their La Liga campaign behind them when they begin their defence of the Champions League title later on Wednesday at home to Cypriot champions APOEL Nicosia.
Would you like to place a soccer bet? Click here to get started in 3 easy steps.