Hungary came from behind in the final four minutes to top neighbours Austria for their second win of the EuroBasket qualification round.
Austria led 69-66 on Jason Detrick's three-pointer with 4:18 to go, but Hungary responded with eight straight points, taking the lead on David Vojvoda's lay-up and then taking advantage of a series of Austrian misses to lead 74-69 on Peter Lorant's lay-up.
Moritz Lanegger's lay-up put Austria back in it, but Adam Hanga responded with a three and then punished a Lanegger turnover with a dunk that made it 79-71, 82 seconds from time.
Hanga added another dunk before Austria scored the final four points of the game in vain.
Austria had led most of the game and were up by as many as nine, 45-36, on Thomas Schreiner's three early in the second half.
Lorant led Hungary with 19 points and 10 rebounds while Hanga added 17. Obie Trotter scored 11 points with eight rebounds, and Akos Horvath and Zoltan Trepak added 10 points apiece.
Rasid Mahalbasic led Austria with 17 points while Detrick and Davor Lamesic had 13 each, Christoph Nagler and Schreiner 11 apiece.
Nedeljko Asceri, Austria head-coach:
"First of all, congratulations to Hungary. We would deserve this win too. We had three games in six days, so at the end we were too tired and made too many mistakes."
Laszló Rátgéber, Hungary head-coach:
"I'm very glad now. We were struggling in the first half, but then we changed our rhythm and improved in defense and offense. [A big] thank you to our fans, they were great today."
Adam Hanga, Hungary:
"It was a very important game for us. In the first half we did not play good enough, but then we improved, so behind real teamwork we won the game despite of that big number of turnovers."
Thomas Schreiner, Austria:
"It's a disappointing loss. We did a good job, but at the end we had no energy to keep our lead. We are young team, three games in six days is probably too much for us."