The Brazilian full-back, 29, has put pen to paper on a new five-year deal at the Bernabeu, having first joined the club back in 2007.
A Brazil worldwide, he has made 406 appearances for Madrid, scoring 28 goals.
The result of the match between Real Madrid and Levante was a 1-1 draw.
Marcelo has been a part of four La Liga championship squads and has won three Champions League titles while with Real Madrid.
Marcelo has made 414 appearances in total for Real and with his contract extension can expect to overtake Roberto Carlos's tally of 527 as the foreign player with the most appearances for the club.
In the referee's match report, Alejandro Hernández Hernández noted that: "In the 89 minute, [Real Madrid] player number 12, Vieira Da Silva Junior, Marcelo, was sent off for kicking an opponent in the back with the ball at a distance where it could not be played".
Marcelo will miss Real Madrid's next two domestic matches after he was handed a two-match suspension for the red card he picked up against Levante.
They begin their attempt to win a third Champions League in a row on Wednesday against APOEL in Group H.