A header from Cristiano Ronaldo sealed the championship, delivering coach Jose Mourinho's first trophy since joining the club last May.
As the final whistle blew in Valencia, fans in Madrid honked car horns and descended into the streets wrapped in the Real Madrid and Spanish flags or waving them in joy.
In central Cibeles Square, traditional home of Real Madrid victory celebrations, thumping music blared into the early hours, lights beamed the team logo across the city hall facade, and fans chanted: "Champions, Champions."
Last weekend Real ended a run of five straight defeats against Barca with a 1-1 draw in the league but at the Mestalla Stadium they went one better with their first trophy since 2008.
There still remain two more mouth-watering matches between the rivals in the Champions League on April 27 and May 3.
"This victory was for the fans as things haven't gone well at the club over the last few years. Mourinho is phenomenal," said Real goalkeeper Iker Casillas.
Mourinho admitted that there was little to choose between the teams.
"I thought it was a great game where players worked hard, were concentrated and did what they had to do," he said.
"Barca are a side which is used to winning and when they didn't score they became frustrated. I was told recently that I was a great coach for titles but not for football -- I am happy to remain that way. I have won four cups now in four countries."
But Mourinho does not believe this victory will have any bearing on the upcoming Champions League clashes.
"We have now won one each and drawn a game this season, so who knows what will happen in the next. I don't think what happened in one game influences another."
Barcelona coach Pep Guardiola hopes his players will bounce back quickly.
"We didn't play well and control the game like we wanted to do and lost the ball a lot," he said.
"We need to lift ourselves for the next games. Madrid played very well in the first half but they performed as I thought they would. It was a similar system as at the Bernabeu but perhaps with some different players."