BASEL, Switzerland — Almost from the outset, it was Germany, not Portugal, that showed flair. It was the Germans, a group runner-up, who dominated the Portuguese, a group winner.

Bastian Schweinsteiger, coming off a suspension, scored one goal and set up two more Thursday night, leading Germany over Portugal 3-2 and into the European Championship semifinals.

It was the first time Germany moved into the final four since it won Euros in 1996, and the first time Portugal failed to make the semifinals in the last three major international tournaments.

Michael Ballack and Miroslav Klose also scored for Germany off free kicks by Schweinsteiger. Nuno Gomes and Helder Postiga had goals for Portugal.

"Up to now, we lacked a bit of creativity. That is why we changed today and that was the key," Ballack said. "Now, you saw what this team has when it can play freely."

In the battle between Manchester United's Cristiano Ronaldo and Chelsea's Ballack, the German came out on top. He delivered the deciding blow when heading in the third goal in the 61st minute, shoving away Paulo Ferreira and heading past an out-of-position goalkeeper Ricardo.

"I did my best," Ronaldo said, although it was hardly the form he showed in the Premier League and Champions League.

The Germans started the upset with a move in the best Portuguese tradition. Podolski set up a couple of short passing combinations and then sped down left wing like Ronaldo would do. In the center, Schweinsteiger beat Ferreira, and given the perfect low cross, right-footed it past Ricardo from close range.

"There is always something left. Everything is possible in football," Schweinsteiger said. "We can battle."

The Portuguese were surprised at such light-footed creativity from the Germans and before they knew it, they were down 2-0.

Schweinsteiger swung in a free kick from near midfield. Ronaldo remained flat-footed while Klose sped by him and powerfully knocked the ball past Ricardo in the 26th.

The strong performance from Schweinsteiger was a perfect comeback for the midfielder after he was sent off for shoving an opponent in Germany's 2-1 loss to Croatia that relegated the Germans to runner-up in Group B.

Germany next will play the winner of today's quarterfinal match between Turkey and Croatia.