Ronaldo became the oldest player to ever score against Germany, and ended his "curse" against the country. The former Real Madrid star has lost all five of his previous matches against Germany, while Portugal have not beaten the 2014 World Cup champions since 2000.
Germany dominated in the first half, but no goals were still scored thanks to the excellence of Portuguese goalkeeper Diogo Costa. This goalkeeper had a great start to the first half when he blocked Leon Goretzka's shot from Germany after only 4 minutes with an excellent save.
Costa once again saved Portugal with a miraculous save from Nick Woltemade's close-range shot. 2 minutes later, he reacted quickly again to stop Goretzka.
Germany took the lead in the 48th minute when Florian Wirtz headed into the net in the penalty area after an accurate pass from Joshua Kimmich.
However, Portugal reversed the situation when they equalized thanks to a substitute Francisco Conceicao in the 63rd minute. 5 minutes later, Ronaldo spoke up with his 137th international goal.
For Conceicao, this victory is more special because his father, Sergio, scored a hat-trick in the last time Portugal beat Germany at EURO 2000.
"We need to enjoy the victory, we won for the first time in a long time against Germany. Tactically, we were excellent and our commitment helped. It was a victory for the whole team.
Now we can recover and re-evaluate the match. We want another individual performance in this shirt," said Portugal coach Roberto Martinez.
Germany tried to change the situation when player Karim Adeyemi came on and fired a powerful shot with his left foot, but the ball hit the post on the right side of Costa's goal.
Vitinha played excellently as Portugal ended the match with a victory just 4 days after he helped Paris St Germain win the Champions League.
German goalkeeper Marc-Andre ter Stegen also had many excellent saves in the final minutes of the match to prevent the away team from scoring more goals.
PSG full-backs Joao Neves and Nuno Mendes all started for Portugal, while Stuttgart striker Nick Woltemade played in his debut match for Germany.
Spain and France will face each other in the remaining semi-final to determine which team will meet Portugal in the final.