With penalties looming in a tense and occasionally brutal clash at Valencia’s Mestalla stadium, the Portuguese forward leaped to crash home a 103rd-minute header from Angel Di Maria’s superb centre.
Di Maria was sent off after receiving his second yellow card just before the end of extra time.
Real’s first domestic cup since 1993 came in Mourinho’s debut season since joining from Inter Milan, denying Pep Guardiola’s Barca, who lead La Liga by eight points, the chance of a second treble in three seasons.
The Spanish giants are also due to meet in the two-legged Champions League semi-final on April 27 and May 3.
“It’s a very important title we’re going to enjoy it,” Ronaldo said in a television interview.
“Mourinho has done a good job,” he added of his compatriot. “He’s helped us a lot. Barca played very well but as you know the team who scores wins.”
In a festive atmosphere in the Mediterranean port city, one half of the 55,000-capacity stadium was decked out in the claret and blue of Barca and draped in Catalan flags, while the other was a sea of white flecked with the yellow and gold of Spain.
Barca had six players from Spain’s World Cup-winning squad in their starting 11 and Real four but any memories of shared glory in South Africa seemed far from their minds in an attritional first half hour.
Real successfully closed down Barca’s creative midfielders and pacy forwards and had much the better of the first half before Pepe crashed a header off the post in the 44th minute with goalkeeper Jose Manuel Pinto well beaten.
Barca had failed to muster a shot on target but the second period was a different story and they utterly dominated possession, Andres Iniesta and Pedro forcing fine saves from keeper Iker Casillas.
However, even World Player of the Year Lionel Messi was unable to break the deadlock and Ronaldo almost put Real ahead when he sped on to Xabi Alonso’s pass in the eighth minute of extra time but his arrowed drive whistled narrowly wide.
He made no mistake five minutes later and his powerful header sent the white half of the stadium into raptures and had them singing Mourinho’s name long after the Barca fans had trooped dejectedly into the night.