Germany booked their place in the semi-finals of Euro 2008 by seeing off a below-par Portugal side in Basel.
Bastian Schweinsteiger sidefooted in the first and his free-kick created the second for the head of Miroslav Klose.
Nuno Gomes finished from close range to give Portugal hope, but they failed to defend another Schweinsteiger free-kick and Michael Ballack headed the third.
Portugal substitute Helder Postiga pulled one back in the dying stages but there was to be no grandstand finish.
Portugal had looked so impressive in qualifying for the knockout stages but Luiz Felipe Scolari's reign ended in disappointing fashion.
Scolari, who takes over as Chelsea boss next month, had suggested their lack of height might be exposed by a physically superior German side.
But it was a failure to defend set-pieces that proved their downfall.
In contrast, Germany gave an accomplished display despite suspended coach Joachim Low having to watch the game from the stands.
They will now face the winners of the Croatia-Turkey quarter-final in the last four and will be strong favourites to progress to the final on this showing.
The selection of Schweinsteiger from the start gave them a spark that was missing from their group games.
Germany's Michael Ballack on his decisive goal
He gave them the lead when he got ahead of Paulo Ferreira to burst into the box and steer home a cross from Lukas Podolski, after he had combined well with Ballack down the left channel.
Germany made it two goals in four minutes when Schweinsteiger's curling free-kick was perfect for Klose to head past Ricardo.
It was Cristiano Ronaldo who looked to be the guilty party in allowing Klose a free run at goal.
The Manchester United winger was unable to influence the game and the 2004 finalists' hopes were dealt a further blow when Joao Moutinho was forced off after half an hour.
It was from Ronaldo's shot that led to Gomes' strike, but it owed more to Deco's bursting run from the edge of his own box.
The Barcelona star released Simao and he found Ronaldo, who was denied by Jens Lehmann only for Gomes to show quickness of mind and feet to turn and fire past Christoph Metzelder's attempted clearance.
It was developing into a wonderfully open game, with both sides continuing the theme of the tournament by committing men forward and playing positive football.
Ballack and then Ronaldo went close just before the break and Pepe should have scored with a close-range header from a corner shortly after the interval.
Germany have reached the semi-final of the European Championship for the first time since 1996, which was also the last occasion they lifted the trophy.
Portugal have not reached the last four for the first time since 1996. In 2000, they lost in the semi-finals to France, and in 2004, Greece beat them in the final.
Nuno Gomes' goal makes him the fourth player to score in three different European Championships, equalling Thierry Henry, Jurgen Klinsmann and Vladimir Smicer.
The Portuguese forward has now scored six European Championship goals. Only Alan Shearer (seven) and Michel Platini (nine) have netted more. Gomes also equalled Luis Figo (14) as Portugal's record appearance maker at European Championships.
Germany have now scored at total of 52 goals in European Championship finals. Only the Netherlands have scored more (54).
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.