Barcelona rallied to a 3-2 win against second-to-last Levante in the Spanish league on Sunday, with substitute Luuk de Jong scoring in stoppage time.
For the rest of the half, Madrid were scatty and imprecise, their finishing spoiled by bad luck but a lack of composure too.
Defeat means Madrid have now gone five games without a victory and by the time Marcelo gave them hope of a comeback at the Santiago Bernabeu, they had gone 481 minutes without a goal too.
Ernesto Valverde rested Lionel Messi for his team's penultimate match of the campaign but it was a defensive horror-show by the Catalans.
Messi's 365th goal in Spain's top flight came inside 12 minutes, with Luis Suarez adding the second before the interval and Paulinho completing the victory.