Pere Tomas guided Spain to their third successive win at the UMCOR U18 European Championship Men as they saw off Croatia 73-67.
Tomas, 16, top scored for Spain with 14 points as well as grabbing five rebounds in a close Group D encounter.
Spain led 18-16 after the first quarter, with Marc Rubio hitting the decisive basket with 32 seconds remaining.
Four points from Tomas then helped the Spaniards record 11 unanswered points at the start of the second period, only for Croatia to fight back to be just three points behind at half-time with the score 35-32.
Another burst from Spain saw them open out a 21-point lead in the third, and despite the best efforts of Filip Vukicevic who top-scored with 16 points, the Croatian fightback in the fourth quarter was to no avail.
Spain will now play Turkey, Bulgaria and the winners of Group B in the quarter-final stage.