LeBron James scored 20 points for the United States as they beat Germany 92-88 in their final warm-up match before the Olympic Games.
The 39-year-old produced 11 points of his game-high tally in the final four minutes as the USA survived a tough test in London.
Germany led 71-68 at the end of the third quarter before James inspired the United States to victory.
He sank a three-pointer with one minute 26 seconds remaining to put the USA 90-86 up, then added two more points to give them a 92-86 lead on the way to the win.
Joel Embiid scored 15 points and Stephen Curry 13 against Germany in a victory which means the United States have won all five of their pre-Olympic exhibition games.
The USA are targeting a fifth consecutive men's basketball gold medal at this summer's Olympics in Paris, with their 12-man squad filled with some of the NBA's greatest talents.
They begin their Olympics campaign against Serbia (28 July), before facing South Sudan (31 July) and Puerto Rico (3 August).