Super Eagles forward Samuel Chukwueze made the difference for Villarreal as he scored two minutes from time on Tuesday to stun former champions Bayern Munich.
The record champions could play city rivals Atletico Madrid in the other semi-final if Diego Simeone’s men can salvage a 1-0 deficit to Manchester City.
Bayern Munich laboured through the first half with only Jamal Musiala’s header, straight at Geronimo Rulli, threatening a breakthrough.
But they upped their performance after the restart and Thomas Müller won possession to set up Lewandowski to finish well from the edge of the penalty box in the 52nd minute.
Bayern Munich controlled the ball but Villarreal defended brilliantly and seized their chance when it came.
Gerard Moreno crossed and substitute Chukwueze’s half-hit finish deceived Manuel Neuer to settle the tie.
“If you take just this game into account, without the first game, we should have gone through convincingly,” Müller said.
“It’s difficult to accept this. I don’t know what to say.”
Villarreal were understandably delighted. “Ever since the draw paired us with Bayern Munich, we have been telling ourselves that we could do it,” said Moreno.
“The belief and the way this team competes have helped us to achieve it.”
Chelsea came close to one of the all-time great Champions League comebacks in the Santiago Bernabéu.
Mason Mount (15th minute) and Antonio Rüdiger (51st minute), with a towering header, levelled the tie in the absence of the away goals rule.
“Not many teams can come here and dominate them like we did,” Rüdiger said. “But then their individual class came to light, and now we are here.”
Marco Alonso’s goal was ruled out before Timo Werner skipped past two defenders on the left and found the net with a deflection in the 75th minute.
Real Madrid hit back immediately with a stunning outside of the foot pass from Luka Modric finding substitute Rodrygo, who volleyed home with almost his first touch.
“It is unbelievable. We were dead until the goal we scored,” Modric said. “In this competition, experience helps, but for me Chelsea are the most difficult to play against.
“But we showed great character and desire. It is a defeat that feels very sweet.”
And when Vinicius crossed for Benzema to bullet home a header, Real Madrid somehow did enough to progress when they held out against a last few frantic attacks.