Cristiano Ronaldo would not be denied.

Ronaldo hit the post twice before scoring the lone goal in the 79th minute, as Portugal edged Czech Republic, 1-0, on Thursday at National Stadium to advance to the Euro 2012 semifinals.

Portugal dominated the majority of the match, but failed to solve Czech goalie Petr Cech until closing stages when Ronaldo drove a header into the right side of the net for his third goal of the tournament.

The Portuguese advanced to the semifinals for the third time and will play the winner of the quarterfinal between Spain and France. Czech Republic, which won Group A, was eliminated.

"It was a very tough game, we did very well," Portugal midfielder Nani said. "Everyone was fantastic on the pitch and it was a great performance by all the players, that's why we got the result."

Czech Republic started well through the first 20 minutes, but struggled to put much pressure on Portugal goalkeeper Rui Patricio. The Czechs managed just one shot - none on goal - in the first half.

The match turned in favor of Portugal midway through first half as Ronaldo had three great chances to open the scoring inside 45 minutes.

Ronaldo slipped through on the right side of the area to drill a shot at Cech, who made the save before the whistle sounded for a foul, in the 25th. Pepe put a ball into the area in the 33rd for Ronaldo, but his bicycle kick was wide.

Ronaldo, a former world player of the year, saved his best moment for the last seconds of the first half as he just missed a spectacular goal in added time.

He chested down a long pass from Raul Meireles in the area and, with his back to the net, held off Czech defender Michal Kadlec, played the ball to himself, then turned and fired past Cech only to be denied by the right post.

Portugal continued its barrage after the break, as Ronaldo drilled a long free kick off the right post in the 49th to hit the woodwork for the fourth time in the tournament, and then drove a shot high 5 minutes later.

Meireles followed a shot over the crossbar, and Nani drove a shot from outside the area that forced a save from Cech in the 58th.

Hugo Almeida, who replaced injured Helder Postiga in the first half, looked to have found the breakthrough in the 59th when he headed past Cech, but the goal was erased for offside.

The Czechs produced a rare chance on the hour, as Vaclav Pilar plowed down the right wing and had Vladimir Darida and Petr Jiracek in the area, but his cross was cleared by Bruno Alves.

The Portuguese were right back on Cech's doorstep, this one when Joao Moutinho blasted a long-range shot that the Czech goalie got a hand on to push over the bar in the 64th.

Kadlec helped Cech in the 74th as he deflected a chance from Nani over the bar to keep the match scoreless into the final 15 minutes of normal time, but it would not stay that way.

Ronaldo found the breakthrough with his head, as he ran onto a right-wing pass from Moutinho and headed in the match-winner. Ronaldo broke into space and hit a one-hop header that bounced just past a diving Cech and into the net.

Denied time and time again during the game, his 35th international goal sealed a spot in the last four as Czech Republic failed to respond to the deficit.

Portugal is back in the Euro semifinals for the first time since 2004, when it lost in the final as host to Greece. Portugal also reached the semis in 1984.