Lyon: Captain Cristiano Ronaldo scored twice in the second half as Portugal managed to hold Hungary 3-3 in a Group F match and qualified for the pre-quarterfinals of the Euro football championship here on Wednesday. Having received a lot of criticism in the draws against Iceland and Austria, Ronaldo scored in the 50th and 62nd minutes to become the first player to score in four European Championships as he helped a below-par Portugal earn third consecutive draw. Already through to the knock-outs, Hungary topped the group with five points as they on Wednesday found their scorers in Balazs Dzsudzsak (47th and 50th) and Zoltan Gira (19th). Iceland finished second as they knocked out Austria 2-1 in the other match. Portugal qualified as one of the best third-placed team - on goal difference. In the match at the Stade de Lyon, Portugal desperately needed a win to ensure a direct qualification by finishing inside the top two positions. But they were shocked in the 19th minute when Gera grabbed gave Hungary the 1-0 lead with a low left-footed drive into the bottom-right corner as Portugal failed to clear a corner. Portugal took time to recover from the early jolt before their best attempt was a free-kick from Ronaldo, whose shot was blocked by a diving Hungary goalkeeper Gabor Kiraly. Portugal got their equaliser three minutes from half-time as Ronaldo delivered a lovely through ball for Nani, who fired a powerful low left-footed strike beyond KirAily into the bottom-left corner. Hungary regained the lead just two minutes after the break as Dzsudzsak's free-kick deflected off Andre Gomes in the Portugal wall, wrong-footing goalkeeper Rui Patricio in process. Trailing 1-2 and with their backs against the wall, Portugal sought inspiration from Real Madrid star Ronaldo and the captain delivered the equalizing goal three minutes later. The 31-year-old flicked in a cross from Jao Mario from close range to bring his side level. Hungary captain Dzsudzsak put his side in the lead in the 55th minute when he cut from the left to the far corner to beat Patricio. But Ronaldo again put his side on level terms when he headed in a Ricardo Quaresma cross from the right by outjumping his marker. Ronaldo got many chances to later to complete his hat-trick but his shots failed to find the back of the nets as the match ended in a 3-3 draw. The Portugal captain also registered another record on the day by playing his 17th match in the Euro Championships - most by any play er - as he moved past former France defender Lilian Thuram and Netherlands goalkeeping great Edwin van der Sar.