However, the 1-0 victory came only after a mighty scare against Slaven Bilic's Croatia.
Mario Mandzukic and Ivan Rakitic had early chances to break the deadlock, and Croatia kept pushing deep into injury time as they went for the equaliser that could have sent them through.
Resolute in defence and dangerous on the counter-attack, Croatia kept the Spaniards at bay for long periods, and Vicente Del Bosque's team will be relieved to have come out top of their group.
Early on, Fernando Torres came close to breaking the deadlock when he brought a good save out of Croatia goalkeeper Stipe Pletikosae.
Although Spain dominated much of the early possession, chances were at a premium.
Jordi Alba blazed wide, while Andres Iniesta poked a shot goalwards but it was saved by Pletikosa.
Torres skipped past Gordon Schildenfeld before firing straight at the keeper from a tight angle.
Moments later, Sergio Ramos drilled a long-range effort which Pletikosa held.
Croatia had a big penalty appeal turned down midway through the first half when Mandzukic was brought down by a crashing challenge from Ramos on the edge of the box. But referee Wolfgang Stark waved Croatian appeals away.
The game opened up as the second half progressed and Spain substitute Cese Fabregas and fellow midfielder Iniesta were able to carve open the Croatian defence. Iniesta squared the ball for Navas to slide home into an empty net.
"It was a very tense match, very tough," said del Bosque. "They closed ranks at the back very well and didn't give us much space.
"We threw on Cesc because we needed not only possession but someone to get forward into goalscoring situations."
Jesus Navas added: "It was a tough match and they managed to play their game well. It was difficult to penetrate their defence.
"We are the kind of players who go all out for victory because that is what we believe in and what we want."
Croatia's best chance of the night fell to midfielder Rakitic, who said: "I'll have several sleepless nights after missing a great chance to give us the lead.
"But we have no regrets because we left it all out there on the pitch, we played our hearts out and we can bow out with our heads high."
Croatia coach Bilic added: "I can only congratulate my players as they played a heroic match but, unfortunately, we didn't win as we didn't take our chances."