They began to celebrate during a break after some technical fouls on Spain with 26 seconds left, then celebrated at midcourt when it was over with "Born in the USA" blaring over the arena's speakers.
"I'm proud of our guys. We played with great character in one of the great games in international basketball history, I think," US coach Mike Krzyzewski said.
Nobody else had been close to the Americans in Beijing. This team's only Olympic competition had been history, in a Dream matchup with guys named Jordan, Magic, Bird and the rest of the US team that dominated the Barcelona Games in 1992.
Forget comparisons to those guys. The Americans were lucky to be better than Spain on Sunday.
Rudy Fernandez scored 22 points and Pau Gasol had 21 for the Spanish, the reigning world champions who were hoping to win their first Olympic gold.
US players appreciated the game Spain gave them. After the contest, they hugged the Spanish players. Bryant had an especially long embrace for Gasol, patting his Los Angeles Lakers teammate on the back.
"They did what they were supposed to do," Gasol said. "We fought hard all the way."
Seeming to appreciate the moment, after congratulating Spain, the team joined in a circle, jumping up and down at center court and waving triumphantly to the crowd as Krzyzewski applauded on the sidelines.
The Americans had won their first seven games by 30.3 points, including a 119-82 rout of Spain. But they never had control of this game, giving up open looks from the perimeter and plenty of points in the paint.
But Bryant, who waited so long to finally wear the red, white and blue, hit two 3-pointers in a big fourth quarter to add the gold medal to the only piece of hoops hardware he didn't already own. The NBA MVP pounded his hands toward the floor in celebration at the end.
James scored 14 points, while Carmelo Anthony and Chris Paul had 13 apiece for the Americans, who had won bronze medals in their last two international events, the 2004 Olympics and '06 world championships.