La Roja's 15-game unbeaten run came to an end in Kiev thanks to a second-half goal from Viktor Tsygankov.
Spain had nearly 72 per cent of the possession, attempted 21 shots to Ukraine's two and were denied eight times by goalkeeper Georgi Bushchan, although they did not create many clear-cut opportunities.
They paid the price for a moment of poor concentration 76 minutes in, as Andriy Yarmolenko played in Tsygankov right through the heart of the defence, and the substitute blasted past De Gea from the edge of the area with the Manchester United goalkeeper having been caught well advanced from his line.
The goal will likely prompt further debate about De Gea's place as Spain's number one, with his form for club and country having been questioned for much of the past two years.
However, head coach Luis Enrique was not prepared to listen to reporters apportion blame on the 29-year-old.
"You can always do more, but blaming De Gea is already a bad habit," he said.
"If David is blamed for a game like this, switch it off and we'll leave."
He continued: "If you attack in a continuous way, you know there are transitions. If a team defends and keeps it at 0-0, they grow, and in one action they've caught us. We have to congratulate them.
"Nothing happens because in one or two games you don't score goals. We created chances to kill them off. It was a game clearly under our control, with opponents closing the passes and the passing lines.
"We created chances with Adama [Traore] through his overlapping. In the end, we went into panic mode. I've lost lots of these games in my career. The opponent is growing and then in a transition…
"The conclusion is I liked the attitude of the players. I like what I see."