- Real Madrid news: All the latest from the European Champions
- Dries Mertens fired Napoli in front against Real Madrid with low angled effort after Marik Hamsik through ball
- Cristiano Ronaldo hit the post after rounding goalkeeper Pepe Reina in an astonishing miss
- Mertens also struck the post in first half with scuffed effort as Italian side dominated the opening 45 minutes
- Real captain Sergio Ramos scored another crucial goal on 52 minutes with a powerful header from a corner
- Ramos then rose again to head another corner in via a deflection off Mertens for an own goal
- Alvaro Morata tapped in late third in second half stoppage time after Ronaldo shot palmed out by Reina
Madrid were given a first-half scare by Napoli who dominated and took the lead through Dries Mertens but the second period was a very different story.
Zinedine Zidane's team had forced only one corner in the first half but they won two at the start of the second 45 minutes and Ramos rose to head home both Toni Kroos kicks, the second via a deflection off Mertens which was given as an own goal by UEFA.
Real Madrid captain Sergio Ramos scored another crucial goal on 52 minutes with a powerful header from a corner
Ramos, who has scored in a number of important games for Real, flicked the ball past Pepe Reina to equalise on the night
Ramos celebrates his header which cancelled out the Napoli away goal and quietened the vociferous crowd
Ramos then rose again to head another corner in via a deflection off the unfortunate Dries Mertens for an own goal
Ramos is crowded by his team mates in celebration as Real passed a severe test to reach the Champions League last eight
Once again Ramos had used his head as Real Madrid were losing theirs. They had started the game badly with a weak clearance from Marcelo and a weak punch from Keylor Navas.
Napoli poured forward as they were roared on by the Sao Paolo stadium that had been filling up for the previous five hours.
The home supporters had plenty to shout about with five shots from Napoli in the first 15 minutes. None of them were on target but Mertens changed that on 24 minutes with his 17th goal in his last 16 games.
Marek Hamsik found space in behind Casemiro and with Dani Carvajal missing in action Pepe did not know whether to go to the man on the ball or stay stuck to Mertens.
His indecision gave the Belgian just enough time to fire past Navas as soon as he was played in.
Real Madrid almost responded immediately but Cristiano Ronaldo's shot came back off of Reina's left-hand post.
Real Madrid's record scorer had come into the game having failed to score in his last five Champions League matches – his worst run for the club.
Madrid were creating chances at the other end but arguing among themselves as they missed them.
Earlier Gareth Bale had crossed from the right and Karim Benzema had back-pedaled into Ronaldo with both jumping for the cross at the same time.
Lorenzo Insigne could have got the second for Napoli before the break. He got between Casemiro and Pepe once more but Navas saved.
Alvaro Morata added gloss to the scoreline with a third for Real in second-half stoppage-time after a Ronaldo shot was saved
Former Juventus striker Morata followed in after Ronaldo's late shot was pushed out into the area by Napoli keeper Pepe Reina
Dries Mertens fired Napoli in front against Real Madrid with low angled effort after Marik Hamsik's through ball
The opening goal was a just reward for Mertens and Napoli as they dominated the first half against a lacklustre Madrid
Mertens also struck the post inside the opening 45 minutes as Napoli looked to overturn a 3-1 first leg deficit
Napoli players celebrate after Mertens beat Keylor Navas with a well-taken low shot into the bottom right corner
Mertens hit the frame of the goal and Hamsik forced a saved from Navas at his near post. The Spanish press had dubbed this game 'Angels in Hell'. The Sao Paulo atmosphere was certainly hot and Madrid were melting.
Napoli had 11 shots in the first half and if they had been more accurate Real Madrid would have been out by half-time.
The hope for Madrid was that statistic about them having scored in each of their last 46 games would carry them through. If they could score, everything would change. Ramos, and Mertens inadvertently, duly took care of business.
Former Juventus striker Alvaro Morata climbed off the bench to get the third in injury time but by then the game had been won.
A victory earned not by Ronaldo, or Bale, or Benzema, but by Ramos. He has scored in two winning finals and his performance in Napoli keeps Madrid's dream of becoming the first team to retain the Champions League very much alive.
Real Madrid looked certain to draw level on the night as Cristiano Ronaldo rounded Pepe Reina after 29 minutes
Incredibly, the Ballon D'Or winner hit the post with the goal gaping, thus ensuring Napoli stayed ahead in the first half
Ronaldo's miss was further fodder for the loud home crowd, who booed the Portuguese star whenever he touched the ball
Real Madrid's Marcelo in action with Napoli's Elseid Hysaj during the first half at the Stadio San Paolo
Real Madrid defender Pepe takes a spectacular tumble under pressure from Napoli midfielder Marik Hamsik
The Naples natives, some of who had been in the ground since 2.30pm, made an enormous racket all night in the stadium
Giant banners were passed around the ground pre-match to create an intimidating atmosphere for the visitors
Real Madrid manager Zinedine Zidane is hoping to make his side the first to win the Champions League in successive years
Napoli manager Maurizio Sarri reacts to events on the pitch as his team take on the most successful side in European history