Atletico Madrid's Saul netted Spain's first goal on 21 minutes with Sandro adding a second on 65 minutes.
Bruma hit a stunning volley from 25 yards on 77 minutes, but Inaki Williams secured Spain's progress as Group B winners with a game to spare when he scored deep into injury time.
"We knew it was a vital game and crucial to get the win to get into the semi-finals," said Spain striker Sandro.
Harrison can add different dimension to Young Lions - Boothroyd
"I've said it before that we have great team – we're like a family on and off the pitch and you can see that out there. We have to carry on in the same way.
"It was a complete performance in many respects and I'm happy personally too as it's always hard to get off the mark 9with a goal) in a tournament like this. I'm especially pleased, though, with the win for the team who were sensational today."
If Portugal win their last match against Macedonia on Friday, they could still qualify for the semi-finals as the best runner-up of the three groups.
Serbia and Macedonia drew 2-2 in the day's other match.
Germany lift U-21 Euros thanks to Weiser header
Parker: Why England keep losing on penalties
Share this article