Great Britain almost squandered a 14-point lead but found an extra gear late in the fourth quarter to start their EuroBasket qualifying campaign with a 91-82 win in Hungary.
Luol Deng led the way with 32 points on his return to competitive action, having missed last year's EuroBasket with a stress fracture.
Britain were looking good for a comfortable win after an 18-5 run put them 51-38 up just before half-time.
Their lead was 12 at the break, but lay-ups from Peter Lorant and Adam Hanga started a 10-0 Hungary run in the third quarter and after GB's shooting touch deserted them, David Vojvoda levelled the scores at 64-64.
Hungary edged into the lead, but not for long as Deng tied it at 71-71 with a three-pointer and another long-range effort from Nate Reinking put the Brits back on top.
Hungary were not going easily, but gradually Chris Finch's men were able to pull themselves clear.
They led by five, 82-77, with 90 seconds left after a Pops Mensah-Bonsu lay-up, and captain Andrew Sullivan then came up with a big offensive rebound and made it 84-77.
Hungary began to foul, but Britain showed good poise at the free-throw line as Ogo Adegboye and Deng sank critical shots down the stretch.
Reinking finished with 16 points while Mensah-Bonsu and Dan Clark each had 14.