Despite being held to just 12 points against Spain, Slovenia's NBA sensation Luka Doncic, found a way to lead his team to victory.
Both teams will advance to the quarter-finals, with Slovenia drawn against Germany, and Spain facing a mouthwatering clash with reigning champs USA.
Doncic shot just two from seven from the floor, but led the team along with Mike Tobey in pulling down 14 rebounds and dished out a team-leading nine assists - just one assist away from a triple-double.
Vlatko Cancar led Slovenia with 22 points, with Tobey adding 16. Ricky Rubio scored 18 for the Spaniards who suffered their first defeat of these Games.
"It was a very tough game," said Slovenia's Zoran Dragic after. "We have dogs in the team. We are five dogs and we’re just trying to stick to it. Even when we were down by 12 points, we believed we could win.
“This is like a big family. We breathe like one, and today we show that even if we are so small country, we have hell of a player.”
Will they need to take anything other than their dog-fight spirit into the knockout rounds? "We will stay dogs, that's OK," Dragic said.
Spain had led 57-45 with 6:47 left in the third quarter, but Slovenia pulled within two by the start of the fourth before securing the win.