Messi, taking his tally to 52 in all competitions this season, scored in the 76th and 87th minutes, the second a typically brilliant solo effort, to settle an ill-tempered clash which saw Madrid defender Pepe sent off in the 61st minute. That incident also saw Madrid coach Jose Mourinho, who yesterday sparked a war of words with counterpart Pep Guardiola, sent to the stands, while Barça reserve goalkeeper Jose Pinto was also shown a red card following an incident at half-time.
However, the end result means Barça, European champions in 2006 and 2009, are now firm favourites to progress to next month's final at Wembley. "We are one step away from the final but we are not at Wembley yet," said Barcelona coach Pep Guardiola. "We respect Real Madrid a lot and we know they are capable of anything so we won't underestimate them."
Messi has now scored on each of his last four visits to the Bernabeu and the late goals are a huge setback for Real coach Jose Mourinho, who was sent to the stands for protesting the dismissal of Pepe. Madrid must now pull off a miracle and win well at Camp Nou in the second leg on 3 May if they are to reach their first final since 2002.
"Another miracle with ten men wasn't possible," said an angry Mourinho, whose side were overwhelmed 5-0 on their previous visit to the Camp Nou. "Yes, I think we are eliminated. We will go to Camp Nou with everything and to get a result but I can't see it. We will be without Pepe and (Sergio) Ramos who didn't do anything and neither did I. I just want to know why? Why did Pepe get sent off? I just want someone to explain. Why did it happen?"
Barcelona welcomed back captain Carles Puyol - who has been absent for all five of his side's defeats this season - but the visitors still had a number of absentees with Andres Iniesta, Eric Abidal and Adriano among the missing. Madrid, who last week ended their three-year wait for a trophy when they beat Barça to win the Copa del Rey final, were unable to call on the suspended Ricardo Carvalho and injured Sami Khedira.
The first half was a cagey affair with Madrid content to let Barça have possession well away from danger and the visitors unwilling to commit too many men forward. That led to Cristiano Ronaldo showing his frustration at one point as well as the home fans, and meant goalscoring chances at either end were few and far between.
Xavi tested Iker Casillas with a well-struck volley early on, while the Barça schemer also had the best chance of the opening period in the 24th minute after latching onto Lionel Messi's pass. However, he was again denied by Spain team-mate Casillas, who blocked his low shot. David Villa also saw a low effort go not far wide as Barça sought a valuable away goal.
At the other end, Madrid fans had to wait until just before half-time to see their side give Barça goalkeeper Victor Valdes something to think about. Ronaldo tried his luck from 25 yards and the ball rebounded back off Valdes' chest. Mesut Ozil looked set to net as he followed up, but Valdes saved his effort and an offside flag would have ruled out any goal anyway.
As the players left the field following an increasingly niggly first half, there was a melee between the sides as they entered the tunnel that resulted in Pinto receiving a red card. Mourinho decided to switch things at the break, taking off Mesut Ozil and sending on Emmanuel Adebayor, who scored twice at the Bernabeu in their 4-0 quarter-final, first-leg win over Tottenham.
Chances early in second half
Both sides had half-chances at the start of the second period, with Messi and Ronaldo seeing efforts blocked, before Madrid defender Sergio Ramos picked up a yellow card which rules him out of the second leg.
Much worse was to follow for Madrid though as they were reduced to ten men when Pepe was shown a straight red card following a challenge on Dani Alves that left the Brazilian writhing in agony. That was the fourth time in four clashes with Barça this season that Madrid have had a player sent off, and Mourinho's anger on the touchline resulted in him being sent to the stands.
Barça sensed a great opportunity to take control of the tie and almost went ahead in the 68th minute when Villa saw a shot saved by Casillas and Pedro headed the rebound inches wide. And their next opening saw them take the lead when substitute Ibrahim Afellay did well to create space down the right and his low cross was turned in by Messi running in at the front post.
Messi was not finished and struck a brilliant second with three minutes remaining to leave Barça with one foot in the final. The Argentina ace dribbled past several Madrid defenders at pace before sliding a right-footed shot past Casillas.