Real Madrid showed their character by beating Barcelona 2-0 in Sunday's top-of-the-table Clasico, leapfrogging their rivals at the La Liga summit after a week in which their pride had taken a beating at home and in Europe.

Brazilian teenager Vinicius Junior scored the opener in the 71st minute with a strike that deflected off Gerard Pique, flummoxing goalkeeper Marc-Andre ter Stegen who had made some jaw-dropping saves, and substitute Mariano added the second in added time.

Real's victory means they lead the standings on 56 points after 26 games, with Barca slipping to second spot on 55, while Zinedine Zidane's side also crucially have the better head-to-head record in the event both sides finish level on points.

Real swallowed chastening defeats by Levante in La Liga and Manchester City in their Champions League last-16, first-leg tie in the past week, but in the second half, they overwhelmed Barca, threatening on numerous occasions before breaking the deadlock.

Barcelona had bossed the first period and twice could have taken the lead but were powerless to stop Real after the interval and their impotence was summed up when Lionel Messi raced toward goal but was easily tracked down by Marcelo.

Marcelo's tackle got as loud a cheer as the goals from Madrid's fans who had not been able to toast a league win over Barca at the Santiago Bernabeu since 2014.

The long-awaited victory was confirmed by an unlikely source in forward Mariano, who had only just come off the bench to make his first league appearance of the season.

- Ronaldo made Bernabeu return to watch Clasico

Barca coach Quique Setien had remarked before the game that Real were under greater pressure to win after they had surrendered a three-point advantage over Barca by drawing with Celta Vigo and losing to Levante.

They were left further frustrated by their 2-1 home defeat by Manchester City, which has seriously jolted their hopes of remaining in the Champions League and put Zidane back under pressure for the second time this season.

The French coach restored Toni Kroos to the starting lineup at the expense of Luka Modric after dropping the German against City and also picked Marcelo over Ferland Mendy at left-back.

Vinicius Junior celebrates his goal against Barcelona. Getty

Setien went for a four-man midfield instead of Barca's usual 4-3-3 formation, prioritising possession over pace in attack.

The first half was end-to-end but lacked quality.

Barcelona created clear sights of goal for Messi and Arthur Melo, both of whose efforts were well saved by Thibaut Courtois.

Madrid's main threat was the electric but raw Vinicius, who routinely got down the left but rarely knew what to do next.

Real looked far more determined in the second half, and Isco forced Ter Stegen into an outstanding flying save and then saw a downward header scrambled off the line by Pique.

The missed chances galvanised the home fans, however, who could sense their team were close to an opening.

There was a touch of fortune to the deflected opening goal, but Real's victory was thoroughly deserved.