Spain beat Slovenia 74-67 on the final day of the Qualifying Round at the U18 European Championship Men 2009 in Metz, France.
The result saw the Spaniards finish with a 4-1 mark to top Group E while Slovenia finished 1-4.
Slovenia never led but threatened often and could have had a chance to make it closer down the stretch.
Trailing 60-48 as the final quarter got underway, Slovenia got within six 64-58, when Edo Muric was fouled on a three-point attempt and hit all three foul shots.
Spain pulled away thanks to Ignacio Llovet and Joan Sastre's timely baskets and looked to have the win secured as they were up 71-60 with about three minutes left.
But the Spaniards lost some of their focus and when Mitja Nikolic hit a transition three, Slovenia trailed by just six with just over two minutes to go. They got within four, 71-67, when Nejc Buda caught the Spanish defense napping and made a lay-up.
Alberto Jodar hit three of four free-throws in the last minute as Spain put the game out of reach.
As has become their habit, Spain got out to a quick start by taking a 9-0 lead with just two minutes played.
They score the game's first 12 points as Slovenia turned the ball over time and time again and only got on scoreboard with 5:16 left in the first quarter.
Joan Tomas' lay-up on a fastbreak - one of many for Spain in the opening period - in the closing seconds made it a 26-12 lead for Alejandro Martinez's side.
And they went up by as many as 16, 30-14, on Miguel Servera basket early in second quarter, but Slovenia eventually found their rhythm offensively, especially from long range, hitting on four of seven attempts in that period alone.
The biggest of those long bombs was that of Nikolic who connected with under a minute left in the half while getting fouled. He hit the free-throw to get Slovenia within six, 41-35, at the break.
Spain extended their advantage to double-digits in an emotional third quarter that saw both Josep Franch and Llovet hit with technical fouls.
That though seemed to motivate the Spaniards further and they led by 15, 59-44, on Franch's corner three-pointer with under two minutes left in the third quarter.