The United States survived a spirited comeback from world champions Spain to win 86-85 in a thrilling warm-up game, sending out a warning to their rivals ahead of the world championship.
The Olympic gold medallists have set out for Turkey with a side shorn of big names such as LeBron James, Kobe Bryant and Dwyane Wade who starred in Beijing.
But the young replacements showed their mettle in a hostile Madrid against a more experienced side, who narrowly lost out on gold in Beijing.
Guard Kevin Durant led the way with game-high 25 points and eight rebounds, closely supported by Derrick Rose and Lamar Odom who sank 13 and 12 points apiece.
Juan Carlos Navarro topped the scoring for the hosts with 20 points backed by Marc Gasol and Felipe Reyes who notched 17 and 16 each.
Spain perhaps missed the influence of Los Angeles Lakers forward Pau Gasol, who was watching from the stands after ruling himself out of the trip to Turkey.
The MVP from the last world championships was sitting just behind the world’s most expensive football player, Portugal and Real Madrid forward Cristiano Ronaldo in the packed arena.
The US laboured past Lithuania 77-61 on Saturday, a side Spain swept aside 94-75 the day before, but they were much quicker into their game, aggressively closing down their hosts and preventing them from scoring until almost the five minute mark.
Durant and Rose spearheaded their charge to a 23-16 first period lead as Spain’s passes were as wayward as their shooting, and the visitors extended the lead to 12 at the break.
Navarro took Spain to within two points at 55-53 midway through the third as the locals threatened a comeback, but Durant sank a breakaway at the end of the third to restore an 11-point advantage going into the final period.
Once again Spain came back though with Ricky Rubio and Navarro at the helm, the latter drawing them level at 80 apiece with two minutes to go.
But Rose held his nerve amidst a raucous local crowd to take the game from the free-throw line in the final seconds.
The US have one more tune-up game against Greece in Athens on Wednesday before the world championships get underway in Turkey on August 28.