Barcelona ended Real Madrid’s 42-game unbeaten La Liga run and opening a six-point lead at the top of the table on Saturday’s El Clasico.
After a tense first half, where Madrid’s Kylian Mbappe had a goal disallowed for offside, Barcelona surged in the second half scoring four goals.
Robert Lewandowski opened the scoring in the 56th minute with a precise strike from outside the box, then headed in another goal just two minutes later from Alejandro Balde’s cross.
Seventeen-year-old Lamine Yamal added to the tally in the 77th minute, becoming the youngest goalscorer in El Clasico history at 17 years and 105 days.
He broke Alfonso Navarro’s 1947 record.
Raphinha closed the scoring with a lobbed finish after a pass from Inigo Martinez, securing a historic win for Hansi Flick in his first El Clasico as Barcelona’s manager.
Real Madrid manager Carlo Ancelotti, also missed the chance to equal Barcelona’s 43-match unbeaten record in La Liga and become the first to guide Real to three consecutive El Clasico home wins since 1991.