Spain completed a dramatic double over Azerbaijan in the men's and women's 3x3 Basketball quarter-finals on Thursday.
In the women's competition, Spain scored twice in the final 21 seconds to eliminate the host nation with a 19-17 victory.
The host's Renara Hayes, and the vocal home crowd, thought she had forced overtime with a two-pointer as time expired. But it was ruled out after a second look from the officials showed the shot was released after the buzzer.
"I am super happy and we are super proud of ourselves," said Spain's Vega Gimeno Martinez. "I love this kind of situation. I was just happy to be booed by the crowd. This gives me even more motivation."
Spain will meet Russia in the last four, after they overcame Ireland 21-11, while Slovenia and Ukraine will contest the other semi-final following successes against Switzerland and Greece respectively.
Spain's men beat a short-handed Azerbaijan 17-14 as the host nation were forced to play their quarter-final without a substitute after Amil Hamzayev went down with an ankle injury during the last-16 win against Israel.
Spain took advantage to pull away late on following key plays from Jose Ignacio Martin Monzon and Alejandro Llorca Castillo to set up a semi-final with no.1 ranked Serbia.
"I used to like them (Serbia), now I hate them," said Martin Monzon. "I just want to beat team. They are a really nice team. They beat us last summer and now I want my revenge."
Russia and Slovenia will also play for a place in the final on Friday, after Boris Jersin scored twice in overtime to lift Slovenia past Greece.