With Real leading 1-0 at the Bernabeu thanks to a deflected 71st-minute goal from teenage sensation Vinicius Jr, Marcelo ensured the scoreline remained that way with a crucial last-ditch intervention to stop Messi as the Argentine bore down on the Real Madrid goal.
Marcelo, 31, raced back to poke the ball away from the Barca ace before teammate Raphael Varane mopped up the danger.
The fired-up Marcelo pumped his fists at the Bernabeu crowd in celebration at the tackle before exchanging a clasp of hands with Real skipper Sergio Ramos.
It turned out to be a pivotal moment as Real maintained their advantage before substitute Mariano sealed the win late on with a run and finish from the right flank, giving Los Blancos their first victory in a La Liga Clasico since 2017.
Marcelo’s all-action performance won particular praise from fans, with the four-time Champions League winner previously coming in for stick for some of his displays earlier this season.
But Marcelo’s inclusion on Sunday was vindication for Real Madrid boss Zinedine Zidane, as was that of Brazilian youngster Vinicius, who opened the scoring by racing onto a Toni Kroos through ball on the left flank before cutting inside and shooting past Marc-Andre ter Stegen with the help of a deflection off the leg of Barca defender Gerard Pique.
It meant Vinicius became the youngest Clasico goalscorer this century, overtaking the record previously held by Messi.
Making his first league appearance of the season, Mariano clinched it for Real Madrid in injury time as he raced clear on the right before bundling the ball in.
Barcelona had their chances, particularly in the first half, although a misfiring Messi was thwarted by Real keeper Thibaut Courtois while Arthur Melo also failed to score when well placed.
Real were the dominant force in the second half however, and had former hitman Cristiano Ronaldo supporting in the stands as he returned to the club where he became all-time top scorer.
Ronaldo was in the crowd after current team Juventus saw their top-of-the-table Serie A clash with Inter Milan postponed on Sunday due to the coronavirus outbreak in Italy.
Real’s victory meant they leapfrogged Quique Setien’s Barcelona to the top of the La Liga table, as Zidane’s men lead the way by a solitary point after 26 games played.