Updated

Hungary beat Iceland in extra time and France edged Spain on Wednesday during tight quarterfinal play in the men's handball tournament.

Iceland, the silver medalist four years ago in Beijing, was the top team in its group but found itself in a close match against Hungary -- which reached the knockout stage only after winning its final group match.

After Iceland netted three consecutive goals late in regulation to move in front, Hungary's Mate Lekai scored in the 60th minute to even the contest.

Both teams scored three times in the first portion of extra time, but back-to- back goals by Laszlo Nagy put Hungary up by two in the 75th minute. That was enough of an edge, and the Hungarians held on for a 34-33 upset to move into the semifinals.

There, they will face Sweden, which defeated Denmark by a 24-22 margin Wednesday.

On the other side of the bracket, France still has a chance to defend its gold medal after barely getting into the semis.

Victor Tomas Gonzalez pulled Spain even with two late tallies, but William Accambray responded in the 60th minute to give France a 23-22 triumph.

It will face Croatia, which defeated Tunisia 25-23, in Friday's semifinal round.