Chelsea's passage into the semifinals of the Champions League wasn't secure until stoppage time on Wednesday at Stamford Bridge.
But a goal from substitute Raul Meireles eased the nerves and handed the Blues a 2-1 win in the second leg that puts them into the semifinals with a 3-1 aggregate victory.
Frank Lampard's first-half penalty kick put Chelsea in control but even after going down to 10 men with Maxi Pereira being sent off in the 40th minute, Benfica made things interesting with a goal from Javi Garcia in the 85th.
However, Meireles put the result away two minutes into added time, setting up a semifinal meeting with Barcelona, which visits Stamford Bridge for the first leg on April 17.
Benfica created some decent chances early in the match but went behind in the 20th minute when Garcia bundled into Chelsea's Ashley Cole inside the penalty area, allowing Lampard to convert from the spot.
Oscar Cardozo nearly leveled the match 10 minutes later when his shot beat goalkeeper Petr Cech but was cleared off the line by defender John Terry.
And things got tougher for the visitors five minutes before the break when Pereira received a second yellow card for a late challenge on John Obi Mikel.
Chelsea had opportunities to finish off the match in the second half, including Ramires failing to tap the ball into the net from a yard out, but made things tough on itself when Garcia headed home a corner kick to give Benfica a chance.
The visitors threw men forward as the match entered stoppage time and Meireles made the most of the chance to catch them on the break. He won the ball in midfield and carried it all the way to the edge of the penalty area, where he smashed a shot past goalkeeper Artur to clinch the victory.
Real Madrid 5, APOEL 2
Madrid, Spain - Cristiano Ronaldo netted a pair of goals as Real Madrid coasted to a 5-2 win over APOEL in the second leg of its Champions League quarterfinal matchup, helping the Spanish side easily advance to the semifinal round.
A 3-0 win in Cyprus by Madrid put Jose Mourinho's side in control, and first- half goals from Ronaldo and Kaka brought an end to any suspense.
Gustavo Manduca scored APOEL's first goal in the 67th minute, but Ronaldo tallied another before Jose Maria Callejon extended the lead with his fifth goal in the competition.
The final eight minutes saw both teams add another goal, but in the end Real was left with a comfortable 8-2 win on aggregate, sending them into the semifinals against Bayern Munich.