Italy had a fairly easy time against Group C whipping boys Ireland, while Spain struggled against Croatia before scoring late to win the group.
Defending European and World champions Spain were given a scare on Monday night as they teetered on the edge of elimination against a lively Croatia before Jesus Navas scored an 88th minute winner in Gdansk.
Italy's 2-0 win in their match against Ireland in Poznan, played at the same time, meant Spain would have gone out of the tournament had they lost to Croatia. As the second half wore on, it seemed it might happen.
Spain dominated possession throughout the match, but seemed to lose a cutting edge as the game wore on. Croatia, meanwhile, knew they needed to risk more - and did so, going close through a 59th minute header from Ivan Rakitic.
Croatia coach Slaven Bilic told reporters after the game that he was proud of the way his team had played and that, after he’d put three strikers into the game in the 66th minute in an effort to get a goal, it "was just a matter of when" Spain would get their own chance to score.
"It was a very difficult game," relieved Spain midfielder Andres Iniesta said after the match.
"We were close to qualification and at the same time close to elimination. We didn't want to suffer like this."
Joining Spain in the quarterfinals is Italy, who overpowered Ireland with a goal apiece from Antonio Cassano and Mario Balotelli.
Ireland had come into the match having not collected a single point in the tournament, and were hoping to save face after losing two matches they were never really in.
Italy went up 1-0 after Cassano’s 35th-minute header, but couldn’t rest easy until Balotelli put the game to bed in the 90th minute.
Ireland were down to 10 men by then, a sign of the battling performance they put in to try and please their fans,
"In the last three games the fans have been fantastic," said Ireland striker Robbie Keane. "It is a shame the team didn't perform as well as we can, because if anyone deserves success it is them,"
Ireland's fans became famous worldwide last week for their full-throated singing in the face of a 4-0 loss to Spain.
The Spanish victory over Croatia put them top of the group with Italy second. Those two sides will face the top two from Group D in the quarterfinals.
Still in contention in Group D are England, France and co-hosts Ukraine. Winless Sweden have already been eliminated.
Author: Matt Hermann (AP, dpa)
Editor: Richard Connor