Gerard Pique scored with three minutes remaining as holders Spain opened their Euro 2016 campaign with a 1-0 victory over Czech Republic in Toulouse.
Spain, winners of the Euros in both 2008 and 2012, dominated possession but had to wait until late on to make the breakthrough against Petr Cech and a resolute Czech backline, who came into the tournament with the worst defensive record of the teams who qualified.
Pique was on hand to head home an inswinging cross from the outstanding Andres Iniesta to send Vicente del Bosque's team joint top of Group D with Croatia.
Alvaro Morata had Spain's best first-half chance, forcing Cech into action from close-range in the first half, while Roman Hubnik turned the ball against his own post after the break.
It looked like Del Bosque's men would be held to a frustrating draw, but Pique nodded in his first goal at a major international tournament to ensure they began with a victory two years to the day since their humbling 5-1 defeat to Netherlands at the World Cup.
Spain now play Turkey on Friday as they continue their bid for an unprecedented third consecutive continental title.
A trio of saves from Cech ensured there were no goals in a relatively quiet first period.
Spain came closest to scoring when Juanfran released David Silva on his 100th cap and his cross allowed Morata to stab towards goal from close-range, with the Arsenal goalkeeper making a key stop.
Cech was also on hand to get an important touch to Morata's left-footed effort after the striker had been set up by Iniesta and then pushed away a Jordi Alba strike.
Czech Republic offered little threat going forward, with David de Gea called into action for the first time just before the break, comfortably saving from Tomas Necid.
The post prevented Hubnik from scoring turning Morata's cut-back into his own goal early in the second half, before Nolito had a goal-bound effort blocked.
Hubnik then threatened at the other end, with De Gea getting down sharply to keep out his effort from Ladislav Krejci's delivery, while Cesc Fabregas made a crucial clearance from Theodor Gebre Selassie's goal-bound header.
Del Bosque changed his striker just after the hour mark, with 35-year-old Aritz Aduriz on to replace Morata, becoming the oldest Spain player to appear in the Euros.
Silva lashed a shot wide, while Aduriz was off-target with an overhead kick and a header in the closing stages, and it looked like the Czechs would hold on for a valuable point until Pique struck.
Iniesta floated in a cross from the left and Pique rose to direct a low header beyond Cech from six yards.
That was not the end of the drama, with De Gea making a pivotal stop from Vladimir Darida in stoppage-time as Spain breathed a huge sigh of relief.