The men's Handball competition took yet another dramatic twist on Day 12, as Hungary needed double extra-time to make it through to the semi-finals, while there was also a last-gasp win for France.
Iceland were on the verge of going through in normal time against the Hungarians, 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.
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 scored two successive goals to lead 33-31 and it proved decisive as they were able to hold out to seal a famous victory.
A tight contest throughout was effectively decided by Niklas Ekberg's shot into an empty net with just over a minute to play.
Dalibor Doder finished top-scorer with six for Sweden, who celebrated long after the final whistle, while Hans Lindberg also threw in six for Denmark in a losing cause.
An even contest was heading for extra-time with the scores tied at 22-22 going into the final 30 seconds, but the Beijing 2008 gold medallists had time for one more attack and when a rebound fell to William Accambray he threw in to send his team through to the last four.
It was harsh on Spain as they led until the 45th minute yet must now pack their bags and head home.
Croatia, winners at Atlanta 1996 and Athens 2004, were not tested by their African opponents and their unbeaten record at London 2012 was never threatened in a game that rounded off a superb day's action.