(CNN) -- Ten-man Chelsea produced an astonishing comeback to recover from 2-0 down on the night and beat defending champions Barcelona 3-2 on aggregate in a scarcely believable Champions League semifinal at the Camp Nou on Tuesday.
Chelsea began the second-leg tie with a slender 1-0 lead and looked doomed when captain John Terry was sent off for violent conduct in the 37th minute and Andres Iniesta put Barcelona 2-1 up overall shortly afterward.
But Ramires put Chelsea ahead on away goals moments before halftime and Chelsea somehow held off wave after wave of Barcelona attack after the break before snatching a 2-2 draw.
Lionel Messi hit the bar with a penalty early in the second half and later had another shot pushed onto the post by Chelsea goalkeeper Petr Cech.
Substitute Fernando Torres completed the most unlikely of wins when he scored on the break in injury time to guarantee Chelsea's place in the final of Europe's top club competition for the second time in the English side's history.
"It is an incredible achievement by this group of players," said Chelsea coach Robeto di Matteo, who took over in early March on an interim basis when Andre Villas Boas was sacked.
"A lot of people have written us off but we showed the character these players have."
Chelsea will play either Real Madrid or Bayern Munich in the May 19 final at the latter's Allianz Arena. They will have to do without Terry, Branislav Ivanovic, Ramires and Raul Meireles, who will all be suspended, but that was at the back of the players' minds as they celebrated one of the club's greatest wins.
"It was not beautiful," Torres said, "and we were playing the best team in the world, but Barcelona did not take their chances and, in the end, it worked for us."
Barcelona, meanwhile, now only have the Spanish Cup to play for after losing to Real Madrid at the weekend and all but conceding the La Liga title.
"It wasn't meant to be this year," coach Josep Guardiola said. "The first thing that goes through my head is immense sorrow.
"We played exceptionally well for 180 minutes, we did everything we could to be in the final. We've never worked this hard to be in a final. We failed because we didn't score (more goals)."
Having come away from the first leg ahead due to Didier Drogba's goal, Chelsea traveled to the Camp Nou knowing Barcelona had won their last 15 home matches in the Champions League.
Things started badly when defender Gary Cahill limped off after 12 minutes and got worse when midfielder Sergio Busquets put Barcelona ahead in the 35th minute from Isaac Cuenca's cutback.
Two minutes later, former England captain Terry inexplicably raised his knee as he ran up behind Alexis Sanchez and was shown a straight red card -- leaving Chelsea without both their center halves.
"I want to apologize to the lads and the fans," Terry said later. "I feel like I've let the lads down."
A minute after Terry departed, Iniesta looked to have set Barcelona on their way to the final when he finished off a trademark passing move with a precise, low shot into the far corner from Messi's through ball.
Terry's absence meant midfielder Ramires was pushed into action as a right back but it was the Brazilian who unexpectedly gave Chelsea hope before halftime.
Barcelona had their own defensive reorganization to carry out when Gerard Pique came off after 25 minutes with a head injury to be replaced by Dani Alves, and the hosts were wide open at the back as Ramires skipped on to Frank Lampard's pass and expertly lifted the ball over the stranded Victor Valdes.
Barcelona began the second half in determined mood and quickly won a penalty when Drogba -- who was otherwise superb -- slid in rashly and brought down Cesc Fabregas.
Messi stepped up to try to score his 64th goal of the season but smacked the bar with his spot kick. The three-time world player of the year is still yet to score against Chelsea.
It still seemed only a matter of time before Barcelona got the crucial goal but as the minutes ticked down amid increasing desperation among the home fans, it began to look like fate was on Chelsea's side.
Sanchez had the ball in the net but the offside flag was up against Alves before Messi was again denied when Cech got fingertips to his shot minutes before full time, leaving him without a goal against Chelsea in eight games.
Torres, by contrast, has hardly found the net since moving to Chelsea but it was left to the misfiring Spaniard to run through and score his eighth goal in 11 games against Barcelona.
In the English Premier League on Tuesday, Bolton came from a goal down to beat Aston Villa 2-1 to raise hopes of escaping relegation and leave their opponents just three points above the drop zone.