Watch: Gerard Piqué breaks Czech hearts with late winner for Spain
Spain got their European Championships defence off to the perfect start, but they left it very late against the Czech Republic.
The 2008 and 2012 champions struck in the last five minutes to earn a 1-0 win, with Gerard Piqué heading home the winner.
With the clock ticking down, Piqué's club team-mate Andrés Iniesta swung in a cross and the Barcelona defender gave Petr Čech no chance.
It leaves Spain level on points, goal difference and goals scored with Croatia, who beat Turkey by a single goal in the first game of Group D.
Spain dominated possession against their opponents and had more than twice as many shots on goal, but Čech and his defence looked to have shut out the holders until Piqué found the net.
There was still time for the underdogs to come close to an equaliser, with David De Gea doing well to keep out Vladimir Darida's fiercely-struck effort.
Spain's next game comes against Turkey on Friday, before their group stage campaign comes to a close against Croatia on June 21.
Victory over the Czech Republic has extended Spain's unbeaten European Championships run to 13 games, with their last reverse coming against Portugal in the Euro 2004 group stages.