Real Betis will face Valencia in the Copa del Rey final after Manuel Pellegrini's men came through a semi-final against Rayo Vallecano.
Leading 2-1 from the first leg last month thanks to William Carvalho's winner, Betis controlled the second leg at the Benito Villamarin before late drama saw it finish 1-1.
The home side were content to keep possession and ensure Rayo had few chances to threaten, with Nabil Fekir mustering the first meaningful effort on target after 72 minutes had been played.
That was until the 80th minute, when former Manchester United forward Bebe unleashed a spectacular strike from a free-kick to level the aggregate scores.
However, in injury time, Borja Iglesias bundled home the equaliser to secure Betis' 3-2 aggregate win.
Betis saw a five-game unbeaten run end in a derby defeat to Sevilla last weekend, but almost put the tie beyond reasonable doubt after just six minutes, Juanmi seeing his header saved.
Isi Palazon fired narrowly wide for Rayo, and Pathe Ciss missed with a header, but there was little to trouble Betis goalkeeper Claudio Bravo in the first half.
Betis looked the more likely after the restart, with Sergio Canales and Carvalho each blasting shots over before Fekir at last produced an effort on target from inside the box, one that Luca Zidane held comfortably.
Andoni Iraola tried to provoke a late fightback, introducing Bebe from the bench, and he responded just three minutes later with a quite stunning strike from 35 yards out that left Bravo with little chance.
Just as extra time loomed, Betis snatched the decider. Bravo picked out Joaquin with a precise kick, the veteran slid the ball to Canales and, as his effort deflected towards the far post, Borja arrived to turn it home under pressure.
What does it mean? Betis on track for beautiful season
Betis have been a thrilling side to watch this season. They scored 47 times in their first 25 LaLiga games of the season, a figure they have only bettered twice in their history.
What Pellegrini's side showed here was nous and discipline. Although Bebe's stunner unsettled their plans, they responded well with late pressure to force Borja's goal and reach the final for a fifth time.
Hit me Bebe one more time
Bebe has had a penchant for the spectacular during his Rayo career, but did anyone truly see that goal coming?
It was an astonishing attempt, the swerve of the ball leaving Bravo clutching at thin air, and it was a goal worthy of at least forcing the extra 30 minutes.
Joaquin sets up dream date
Joaquin had just nine touches of the ball after coming on in the 82nd minute, but one of them was a perfectly weighted pass to release Canales for the equaliser.
The 40-year-old has won this competition twice before: once for Betis, and once with Valencia. He now has the chance to lift it for a third time, if he can beat his old club.
What's next?
Betis host LaLiga champions Atletico Madrid on Sunday, while Rayo head to Cadiz.