(CNN) -- Inter Milan fought back to stun holders Barcelona 3-1 in the first leg of their Champions League semifinal on Tuesday.
Pedro had given the visitors a 19th-minute lead, but goals from Wesley Sneijder, Maicon and Diego Milito turned the match on its head to inflict the biggest defeat coach Pep Guardiola has suffered since taking over the Catalan giants.
The two teams had met in the group stages, with Inter failing to score on both occasions, and Jose Mourinho's side got off to the worse possible start when falling behind with 20 minutes not yet on the clock.
Former Inter defender Maxwell made his way to the bye-line on the left, after a typically flowing Barca move, and he pulled the ball back for the in-form Pedro to slide home his shot from the edge of the area.
But Inter refused to lay down and they levelled on the half-hour mark when Diego Milito found Wesley Sneijder on the left and the Dutchman placed his shot past goalkeeper Victor Valdes.
Things got even better for the hosts three minutes after the interval -- and Milito was again involved in the build-up.
The Argentine forward was given time to pick out Maicon at the near post and the Brazilian full-back, who was also on target for Inter against Juventus last Friday, toe-poked the ball home.
Barca threw everything at the Inter defence in their bid to get back into the game, but that left them vulnerable at the back and Milito scored the goal his overall play deserved just after the hour mark.
Samuel Eto'o's cross was unintentionally headed on by Sneijder for Milito to nod home from what appeared to be an offside position.
Holders Barca will now have to win 2-0 in the second leg at the Nou Camp next week in order to reach the final being played at the Bernabeu, home of bitter rivals Real Madrid.