Jose Mourinho and Cristiano Ronaldo were sent off as Real Madrid lost 2-1 to Atletico Madrid in a stormy Copa del Rey final at the Bernabeu.
Ronaldo put Real in front with a header following Mesut Ozil's corner before Diego Costa levelled.
He produced a composed finish after Radamel Falcao's pass before Real hit the post three times through Ozil, Karim Benzema and Ronaldo.
But Joao Miranda's extra-time header secured a famous victory for Atletico.
In a bad-tempered Madrid final, Atletico also finished with 10 men as Gabi was ordered off after encroaching at a free-kick to earn a second yellow card.
But the visitors held on to cap a disastrous night for Real and their manager Mourinho, who has hinted that he could leave when the season ends in two games time.
Defeat means the former Chelsea boss, who has been linked with a return to Stamford Bridge, ends the campaign without any major silverware.
Mourinho was sent from the bench for protesting a referee's decision in the 76th minute.
The Portuguese reacted furiously when the official awarded a free-kick to Atletico, racing to the edge of his technical area and gesticulating wildly.
Ronaldo followed his manager down the tunnel six minutes from the end of extra-time, the former Manchester United player appearing to flick out his boot at Gabi's face after a challenge on him by the Atletico player.
This was a final played out between second versus third in La Liga and the stakes could not have been higher.
While Mourinho was desperate to get his hands on a trophy after disappointment in La Liga and the Champions League, Atletico were determined to secure a rare win over their neighbours.
The Madrid derby was dressed up as a shootout between Ronaldo and Falcao, the rival forwards having scored a combined total of 64 goals in the Spanish League this season.
And both would go on and play significant roles in front of a raucous crowd swelled by more than 30,000 Atletico fans inside Real Madrid's Bernabeu Stadium.
Real struck first after 14 minutes, Ronaldo leaping high above the visitors defence to power Ozil's corner beyond the reach of Thibaut Courtois, the on-loan goalkeeper from Chelsea.
That was goal number 55 of the season for the former Manchester United player in a Real shirt and his 201st career goal for Real.
Yet, despite Luka Modric's impressive work ethic in the Real midfield, Atletico were level in the 35th minute.
Falcao, so often this season the scorer, this time turned provider as he produced a wonderful pass for fellow south American Costa to score with a delicate left foot finish in-off the post.
Diego Simeone's Atletico rode their luck as Real were denied by the post on three occasions before extra time.
First Ozil hit the woodwork from 20-yards before Benzema was also frustrated in the 61st minute with Ozil denied from the rebound by Juanfran's clearance off the line.
Then Ronaldo hit the post from a low free-kick in the 68th minute and Michael Essien spurned a glorious chance to score after the ball rebounded into his path before Mourinho was sent from the bench.
With the scores level after 90 minutes the final went into extra-time.
Atletico had not tasted victory over Real for 14 years but Miranda's header from Koke's 98th minute cross changed all that.
Ozil was denied an equaliser by another excellent save before Ronaldo was sent off, Gabi following him before the final whistle in what was an absorbing final.