Italy earned the victory they needed against an already eliminated Republic of Ireland to go through to the last eight of Euro 2012.
Ireland started with purpose but went behind when Antonio Cassano headed in a near post Andrea Pirlo corner.
An equaliser would have knocked Italy out and their keeper Gianluigi Buffon smartly saved a Keith Andrews strike.
Andrews was sent off for a second booking before Mario Balotelli volleyed in to settle Italian nerves.
Italy still had to endure a few more anxious moments as a Croatia equaliser against Spain in the other Group C game would have meant they were out of the tournament.
But Spain won and Italy will now play the winner of Group D, which includes England.
Ireland put in a more solid performance than in their two previous defeats, although it might not be enough to stop some of their old guard calling time on their international careers, and Shay Given, Robbie Keane, Damien Duff and Richard Dunne will all be left to mull over their futures.
The Irish had beaten Italy 18 years ago to the day at the 1994 World Cup but despite starting with pace and pressuring their opponents, they suffered from some poor decision making in the final third.
Italy weathered the Republic's early enthusiasm before gradually pinning their opponents back and being rewarded for their perseverance.
The opener came after some costly mistakes by Ireland, which started with Glenn Whelan giving the ball away to Italy midfielder Andrea Pirlo.
Pirlo released Antonio Di Natale and he skipped over keeper Given but saw his effort from an acute angle cleared off the line by Sean St Ledger.
Ireland escaped this time but Given, so unusually uncertain at Euro 2012, quickly spilled a long range Cassano strike and the Azzurri seized on the error.
Cassano got his head to a near post Pirlo corner and although Given got a touch, the ball had already crossed the line before Duff - captain on his 100th Republic appearance - cleared.
The goal knocked the wind out of Ireland's sails and Given had to save a Di Natale shot as Italy threatened to overwhelm Giovanni Trapattoni's deflated side.
To their credit, the Republic regrouped and caused Italy some anxious moments, although only a powerful 25-yard shot from Andrews called Buffon into any serious action.
Andrews, already booked in the first half, was sent off after picking up a second yellow card.
He then furiously kicked out at the ball on his way off as he epitomised the frustrations of so many in the Ireland camp after a tournament in which they were comprehensively outplayed.
And Ireland's misery was compounded when Balotelli, side on to goal and with a defender in close attendance, volleyed in from a late corner.