Three minutes later, Schweinsteiger's free kick overpassed Portugal's defense wall and found unmarked Klose, who headed the net with ease.
In the 61st minute of the second half, Schweinsteiger assisted Ballack's header with a cirling free kick, widening Germany's lead against Portugal.
On the Portugal side, coach Liuz Felipe Scolari made no change to its prime lineup in the group matches and stuck to the 4-2-3-1 system. Gomes served as lonely striker while Critiano Ronaldo and Simao Sabrosa played the backup wingers.
The runner-up of Euro 2004 also staged formidable offensive edge.
In the 39th minute, Portugal fought back when caption Gomes found the net with a pass from C. Ronaldo.
Ronaldo penetrated into Germany's area rapidly, his shot was bounced back by German goalkeeper Lehmman, but the ball went to the feet of Gomes, availing him of easy shot.
In the 87th minute, Helder Postiga's header narrowed the gap with Germany.
Despite lagged behind Germany, Portugal still created many opportunities.
Portugal's Cristiano Ronaldo (R) and Germany's Michael Ballack react during the quareterfinals at the Euro 2008 Championships in Basel, Switzerland, on June 19, 2008.
In the 10th minute, Gomes missed a good chance as Simao sent a superb pass from the right side of the area, but he missed the ball.
In the 19th minute, Gomes's powerful shot was just above the cross bar.
During the second half, rain did not dampen the enthusiasm of Portugal to stage attacks. In the 55th minute, Gomes missed a superb pass from Ronaldo, while one minute later, unmarket Pepe headed the ball just above the cross bar.
However, Ronaldo did not get enough support from his teammates, the Premier League best scorer had to bid farewell to Euro 2008 with regret.
Germany will face the winner between Croatia and Turkey in the Euro 2008 semifinals on June 25.
Germany's Bastian Schweinsteiger (L) breaks through the defense of Portuguese players during the quarterfinals at the Euro 2008 Championships in Basel, Switzerland, on June 19, 2008.
Portugal's Deco (Top) challenges against a player of Germany during the quareterfinals at the Euro 2008 Championships in Basel, Switzerland, on June 19, 2008.
(Xinhua News Agency June 20, 2008)