Substitute Klaassen then secured the victory deep in injury time, following up to score after Mendy had saved from Depay, who had also come off the bench.
Spain were hoping to exact revenge for the 5-1 thrashing they suffered at the hands of the Dutch at last year's World Cup, but their chances were undone by two goals in the opening 15 minutes.