Spain were made to pay for a host of wasted chances as Ukraine inflicted their first defeat in nearly two years.
Spain had 21 shots in total but Ukraine needed just one to score.
Substitute Viktor Tsygankov ran onto West Ham forward Andriy Yarmolenko's pass to beat David de Gea.
Luis Enrique's side had not lost since Croatia beat them 3-2 in November 2018.
About 15,000 fans were allowed in to watch the Nations League game.
⚽️ Ukraine, Luxembourg, Malta & Faroe Islands register #NationsLeague victories! ???— UEFA Nations League (@EURO2020) October 13, 2020
Result of the night belongs to _____________ ?