There were around 20,000 fans inside Kiev's Olympic Stadium, the venue where La Roja won Euro 2012 to cap an unprecedented four-year spell of dominance.
Spain had less to celebrate this time, though, as goalkeeper Georgi Bushchan made eight saves to keep Luis Enrique's side at bay before Viktor Tsygankov capitalised on some slack concentration at the back to score the winner 14 minutes from time.
Spain remain top of their group but there will be plenty to play for when the competition resumes next month.
1 - Adama Traoré is the only player to have attempted 10+ dribbles (13/10) and 10+ crosses (12/4) in a single game for Spain since at least September 2006. Tireless. pic.twitter.com/SmSYvIv6lS— OptaJose (@OptaJose) October 13, 2020
Bushchan tipped over a header from Rodrigo Moreno as Spain started positively, and Ansu Fati should have done more than shoot straight at the keeper after Sergio Canales nudged the ball into his path.
Bushchan got fingertips to a Sergio Ramos free-kick, denying the defender a goal to mark his 175th international appearance, the same number as veteran Italy keeper Gianluigi Buffon.
Ukraine had just 21 per cent of the ball in the first half and scarcely got near David de Gea's goal, but they should have taken the lead early in the second, Oleksandr Zubkov dragging a shot well wide after Serhiy Sydorchuk put him clean through.
Ferran Torres and Mikel Oyarzabal came on to freshen the Spain attack, but it was Rodri who next came closest, whistling a low shot just wide of the left-hand post from the edge of the area.
Bushchan stayed big to deny Oyarzabal from close range and Ferran following a dazzling run, before his kick led to the breakthrough.
With Spain's midfield and defence out of position, Andriy Yarmolenko played in Tsygankov and he drove through the gap between the centre-backs to finish expertly past De Gea, who had strayed curiously far from his line.
What does it mean? Spain stay top but stern tests are coming
They have scored just once in three matches in this international break and the concerns about their lack of in-form number nines is not likely to have diminished.
Ukraine are level with Germany on six points and could yet spring a shock by progressing to the finals.
Traore passes his test
Making his first Spain start here, Adama Traore showed he deserves a regular spot down the right-hand side.
He was an obvious threat with his direct runs all game, but there was, crucially, an end product. He misplaced just two passes and provided more than double the number of crosses than any other player.
Luis Enrique needs more from midfield
Spain's middle three have become adept at keeping games under control - they had kept five clean sheets in six games before this defeat – but they offer little by way of an attacking threat.
Luis Enrique ideally needs players more willing to break the lines and support the central striker, with Rodrigo too often isolated as crosses kept coming in.