Goals from strike duo Antonio Cassano and Mario Balotelli helped Italy seal a quarterfinal berth with a 2-0 win over 10-man Republic of Ireland in Group C.
Ireland, who had lost 3-1 and 4-0 to Croatia and Spain respectively, put on a much better show in their final group game, despite having already been knocked out of the tournament.
Italy go through as runners-up with five points. Spain, after their 1-0 win over Croatia, finish as group winners and will face the second-placed team of Group D, while Italy take on the winners of Group D.
Italy, which struggled to create too many chances, got their first goal through Cassano, who headed in off an Andrea Pirlo corner in the 35th minute.
Ireland's best chance came in the 77th minute, when Keith Andrews forced a smart save from Gianluigi Buffon off a freekick. Andrews, however, got sent off after picking up a second yellow card for dissent in the 88th minute. Seconds later, Balotelli hooked home a corner from Pirlo to net Italy's second.
Italy coach Cesare Prandelli was delighted to pick up a win. "It was a very difficult match. We came up against a team that made us suffer.
"Today, we knew that heart mattered more than quality. Tonight we created a lot. I hope it will also be like this in the next match."
Ireland's Italian coach was proud if his team's display against Italy. "I am proud of our commitment. Italy beat us, but we gave them our honour, our commitment and maybe we deserved a little bit more.
"In my life, I have had many successes and been the manager of great teams. I have always had the habit of winning and not losing and when I lose, I don't sleep at night. I think about if I have made mistakes.
"After the Croatia and Spain games, I would like to have immediately played the game again, but I think we played a good game against Italy tonight.
"The willingness is there to come back with fresh energy and a new squad to do better, and I can't wait for the new season to start."
Ireland captain Robbie Keane paid tribute to the travelling fans. "The last three games, they've been fantastic," he told BBC.
"It's a shame we didn't perform as well as we can and perform for them because if anyone deserves it, it's them.
"I think we played well tonight without really creating too many chances. It's one of those things. It's certainly disappointing we didn't get something out of the group.
"We're all disappointed, but we've been beaten by better teams."