Ronaldo had a chance to put Portugal ahead late in the first period of extra-time in a tense, goalless tie in Frankfurt.
The 39-year-old stepped up to take the spot-kick after a foul on Diogo Jota, but his effort was superbly saved by Jan Oblak.
After scoring his previous 29 penalties, Ronaldo was visibly stunned to see Oblak keep out his shot and held his head in disbelief.
Seconds later the whistle went for half-time in extra-time and that was the signal for Ronaldo to start openly weeping as he stood in a huddle of Portugal players.
Consoled by team-mate Joao Palhinha, Ronaldo was able to wipe away his tears and continue playing when the match resumed.
Portugal fans sang “Viva Ronaldo” after his emotional outburst was shown on the big screen in the Frankfurt Arena.
Former Manchester United and Real Madrid star Ronaldo regained his composure in time for the shoot-out and got a measure of revenge as he scored the opening kick to put Portugal on course for victory.
After aiming to Oblak’s left for his penalty during extra-time, he opted to go to the right in the shoot-out and squeezed his effort into the corner.
Holding up his hands to the Portugal supporters in a gesture of apology for his earlier miss, Ronaldo was clearly relieved as he walked back to join his team-mates on the halfway line.
Three penalty saves from Portugal keeper Diogo Costa ensured Ronaldo’s redemption was complete as Roberto Martinez’s side booked a blockbuster quarter-final meeting with France.
“First it was sadness and then it was joy, that’s what football gives you, inexplicable moments, a bit of everything,” Ronaldo said.
“I didn’t make a single mistake this year and when I needed something the most, Oblak saved it.
“Slovenia spent the whole game defending and when that happens, it all becomes difficult.”
Portugal boss Roberto Martinez saluted Ronaldo’s refusal to let his meltdown ruin his focus in the shoot-out.
“Ronaldo missed a penalty and then was decisive when he started the penalty shoot-out, he paved the way,” Martinez said.
“It was a victory for unity, from the dressing room. Cristiano is our captain and he showed that in life and in football there are difficult moments and we can’t give up.
“We have to keep going and it was a demonstration of what to do when things aren’t going well.”