Spain showed quick recovery skills with a 60-46 win over hosting team Latvia in Group C.
Both teams are tied with a 1-1 record before the last and deciding day in the qualifying round.
After the loss in the first day to Montenegro the Spanish side proved it can make the needed switch, and in a great defensive display stopped Latvia on no more than 13 points in the second half, after a close first one.
Marc Rubio and Pablo Aguilar led Spain with 12 points each with the second adding nine boards and two blocks. Victor Claver added nine points and seven rebounds.
Arturs Berzins had 13 for the losing side while Dairis Bertans scored half of his dish last night - 12.
Latvia started with big momentum and climbed to an early 7-2 lead, before Spain's defense stepped up to finish the first quarter down 11-10.
The locals maintained the lead throughout most of the second quarter while Spain enjoyed two big dunks by Xavier Rabaseda, on the way to a 33-30 Latvian half time lead.
For more than nine minutes in the third quarter Spain allowed just a single field goal, and stormed over Latvia to hold a double digit lead, 50-39, entering the deciding quarter.
The scenario stayed the same as Latvia couldn't find the path to the net in the closing minutes.
Spain held on to their stable lead and celebrated a big win that saved them from trouble.
The Spaniards will face Bulgaria tomorrow, and Latvia will take on Montenegro in the last game of the day.