Hungary are through to the semi-finals of the men's handball tournament after an epic double extra-time victory over Beijing silver medallists Iceland in the Basketball Arena.

The Nordic team was on the verge of going through in normal time, leading 27-26 and having a penalty with just 15 seconds remaining, but it was missed and Hungary forced the additional period three seconds from the end.

With the tie still level in the second of two five-minute halves of extra-time, Hungary finally made their move to win by a single goal and send the Basketball Arena crazy.

Iceland, tipped for gold, advanced through Group A of the preliminary stage with a 100% record, which included beating France in a re-run of the Beijing 2008 gold medal match, while Hungary needed a final-day win over Serbia to book their place in the last eight.

But the start of the match did not go to form as the central Europeans blitzed into a 5-1 lead after five minutes, with Iceland struggling to adapt to the new surroundings of the Basketball Arena.

However, they did find their groove and they scored eight out of the next 11 goals to take the advantage at 9-8 for the first time after 20 minutes, but the topsy-turvy nature of the first half continued as Hungary rattled in four unanswered strikes to earn a 16-12 lead at half-time.

A classic was unfolding as five successive goals from Iceland made it level pegging and the score then advanced to 26-24 to Hungary, setting up a grandstand finish with five minutes left.

Iceland then produced a three-goal salvo to edge into the lead for the first time since the 12th minute and it was well timed with 90 seconds remaining.

They had the chance to seal the win with a penalty in the final 15 seconds, but Snorri Steinn Gudjonsson missed and they were made to pay as Mate Lekai threw in with three seconds left on the clock to send the game into extra time with the scores at 27-27.

A tight first half of the additional period saw the score advance to 29-29 and that became 30-30 as a second set of two five-minute halves was required to separate the two teams.

Hungary finally earned some breathing space and score two successive goals to lead 33-31 and it proved decisive as they were able to hold out to seal a famous victory.

They go on to meet either Sweden or Denmark in the last four on Friday, while Iceland are left to pack their bags, but exit the competition with their heads held high.