Croatia had taken the lead thanks to a Andrej Kramaric finish, before the Spanish side leveled just moments later thanks to a Dani Ceballos strike.
The home side were awarded a corner on the left side, which was taken short to enable Luka Modric to get a better angle for a cross.
The Croatia captain was given just that, and swung a deep ball in to the far post with great pace.
Jedvaj's run was perfectly timed, as he was able to head in at the back post, without a Spanish defender picking him up.