Jesse Joensuu was the Finnish hero, with two goals in the game including the winner with just 8 seconds remaining.
The Lions were level at the end of the second period, having gone ahead through HV71 forward Joensuu on 33.27, only to concede a Kyle Palmieri equaliser just 31 seconds later.
Bobby Ryan scored the second goal for the US on 41.39, before Mikko Koivu equalised for the Finns on 53:02 after the puck went in off his skate. A lengthy delay ensued while the referee consulted TV replays.
The US has a lacklustre record at the World Championships, having finished no higher than third since 1950. They did perform well in Helsinki, however, and following a 5-0 win over Finland in the group stage they had high hopes of advancing.
The Finns were criticised for poor showings against Canada and the USA last weekend, and their roster features just four NHL players. They were under strong pressure to perform ahead of the quarter final, even though no host nation has won the tournament since 1986.
The home team will now play Russia in the semi final. Russia overcame a spirited Norway—on Norway’s National Day—to run out 5-2 winners in Stockholm.
Slovakia beat Canada 4-3 to go through to the semi-finals, in which they will face either Sweden or the Czech Republic. The semi-finals will be played at the Helsinki Arena on Saturday, with the final and bronze medal match to follow on Sunday evening.