After two losses to open the games, Hungary finally found the form that won it the last three Olympic titles. Zoltan Szesci made eight saves in goal in Hungary's strongest defensive performance of the tournament.
"This was our best match of the tournament and I'm very happy about this performance and our defence was perfect," Hungary star Tamas Kasas said. "We have to immediately forget this match and look to the next one in two days because that will be more important. We have a chance. The team is very good now, but we have to continue on this road."
With both teams already qualified for the quarterfinals, the U.S. loss leaves it even with Hungary in Group B with six points but behind in the head-to-head tiebreaker.
Gold-medal favourite Serbia routed Romania 12-4 to win the group ahead of Montenegro, which cruised to an easy 13-4 win over Britain.
The U.S., which won silver in Beijing four years ago, plays Group A winner Croatia — which beat Kazakhstan 12-4 — when the quarterfinals start on Wednesday, while Australia is matched with Serbia. World champion Italy beat Spain 10-7 to face Hungary, while the Spanish get Montenegro next.
After a tight first quarter, Hungary broke the game open early in the second with three goals in quick succession for momentum and a 4-0 lead. U.S. captain Tony Azevedo converted a penalty to pull one back, but the Americans never looked capable of truly cracking a Hungarian defence that clearly wanted to prove itself after a string of shaky performances earlier in the tournament.
On the other end of the pool, the Hungary attack whipped in goals from long distance, underlining the defensive woes that have hurt the American in two straight losses in London after opening the games with three wins.
A clearly frustrated Azevedo, who is playing in his third Olympics, said the Americans' problem was simple: "It's defence, that's it."
"Six goals is not enough, but that's fine," he said. "But when on defence you can't make a stop, you can't expect to win. Defence is the part of the game that's really the easiest to change. It's heart and it's passion, and right now we're not playing with it, and I honestly can't tell you why."
Monday's game was a rematch of the 2008 Olympic final in Beijing, which Hungary won 14-10.
Earlier, Australia filled out the quarterfinal bracket, advancing to the knockout stage by upsetting Greece behind three goals from Rhys Howden.
Needing a victory to advance to the quarterfinals, Australia used a five-goal second quarter to grab an 8-5 lead by halftime, then scored the first three goals after the break to extend it to 11-5. Greece, which could have advanced with just a draw, never recovered.
"It was a relief. We had a lot of criticism, and we had a long meeting yesterday that was player driven so the accolades go to those guys," Australia coach John Fox said.
Italy stormed out 4-0 before hanging on for a victory that saw it swap places with Spain in the final group standings. Danijel Premus led Italy with three goals while captain and goalkeeper Stefano Tempesti made clutch saves to preserve the win.
Croatia, meanwhile, had little trouble with winless Kazakhstan, pouring it on early to open up a 5-0 lead and cruise to an easy win. Niksa Dobud scored five goals for Croatia, which already had secured the group's top seed for the knockout stage.
"It don't mean nothing before the quarterfinals," Dobud said in English. "If we lose there we go home, so we need to be good at the right time in the quarterfinal and then we go for medals, and that's the reason we came here."
With the loss, Kazakhstan finished at the bottom of Group A. Britain, which only qualified for the competition as the Olympic host nation, finished last in Group B behind Romania.
Ryan Lucas can be reached on twitter at www.twitter.com/relucaszSuggest a correction