Great Britain got within sight of a shock win over Spain but eventually went down 79-78 on a dramatic night at the Basketball Arena.
Chris Finch's men looked out of it when trailing the world number two side 61-48 at the end of the third quarter.
But they twice came within two points of the Beijing silver medallists late on before a misplaced pass allowed Spain to score on the counter.
Luol Deng nailed a three-pointer with 7.1 seconds left but Spain held on.
Later on, the USA cemented their position as nailed-on favourites for gold as they set an Olympic record for scoring in a crushing win over Nigeria.
The United States beat Nigeria 156-73, surpassing Brazil's record points haul of 138 from Seoul in 1988.
GB coach Finch remains confident GB can still qualify but wants more protection for NBA All-star Deng.
"We are not going to win games unless we are close," said Finch. "We made shots, we defended, we created turnovers but we didn't get that foul call and these things happen.
"We are not going to get double-digit wins, part of our programme is to fight and put ourselves in that position [to win].
"There were some inconsistencies from the referee. We have an NBA player, and I don't think he's [Deng] getting the respect he deserves for an All-star level player.
"Luol is a very nice guy. Sometimes he's too nice of a guy. I was happy to see him angry because he needs to be angry. He deserves more respect than he's getting."
Britain have now lost all three games in the tournament but still have a chance to progress with two games remaining against Australia and China.
Earlier, in another classic in Group B, Russia pipped Brazil to win 75-74. They scored a three-pointer with four seconds left on the clock to qualify for the last eight, while Australia beat China 81-61.