Italy tops Ireland, advances to quarters
Cassano headed in with his back to the goal by the near post following a corner kick in the 35th minute on a warm and muggy night at the Municipal Stadium Poznan.
Balotelli came on as a substitute and doubled the lead in the 90th, a minute after Ireland was reduced to 10 men with Keith Andrews picking up his second yellow card.
Still, Italy had to wait a few moments after the final whistle to celebrate after receiving word that Spain beat Croatia 1-0 in the other group match.
Italy will meet the Group D winner Sunday in Kiev - with France, England and co-host Ukraine among the possible opponents.
Spain won the group with seven points, Italy finished second with five, Croatia was next with four and Ireland - which was already eliminated - exited its first major tournament in 10 years with none.
The victory ended a five-match winless streak for Italy, which began the tournament with two draws following three friendly losses.
Italy controlled the match for long stretches but Ireland - managed by former Azzurri coach Giovanni Trapattoni - threatened often with counterattacks.
Ireland goalkeeper Shay Given got his hand to Cassano's header but couldn't prevent it from going in.
Cassano fell ill with stroke-like symptoms on AC Milan's team plane in October and then required minor heart surgery. He was out for five months and has said repeatedly that he thought he might never recover.
Cassano also stood out for Italy at Euro 2004, but he has was left out of the Azzurri's last two World Cup squads by former coach Marcello Lippi.
Balotelli's goal was a work of art, with the 21-year-old striker acrobatically wrapping his shot around defender John O'Shea in mid air, as he met a corner kick from Alessandro Diamanti.
Having started Italy's opening two matches, Balotelli replaced Antonio Di Natale in the 74th.
With the temperature hovering at 30 degrees Celsius, half the stadium was filled with green-clad Irish fans - even with their team already assured of going home - while there was only a small pocket of Italian supporters.
Ireland winger Damien Duff earned his 100th cap and was given the captain's armband by Robbie Keane to celebrate the milestone. Trapattoni fielded the same lineup from an opening 3-1 defeat to Croatia, which contained the bulk of the players who helped the Irish qualify for the Euros for the first time in 24 years.
Italy coach Cesare Prandelli made four changes from the Azzurri's opening two games. Most notably, Di Natale replaced Balotelli alongside Cassano in attack. Also, Ignazio Abate, Andrea Barzagli and Federico Balzaretti came on in defense, allowing Daniele De Rossi to move back to his natural position in midfield.
Ireland wore black armbands to commemorate the 18th anniversary of shootings in Northern Ireland that killed six people.
Italy: Gianluigi Buffon, Ignazio Abate, Andrea Barzagli, Giorgio Chiellini (Leonardo Bonucci, 57), Federico Balzaretti, Andrea Pirlo, Claudio Marchisio, Thiago Motta, Daniele De Rossi, Antonio Di Natale (Mario Balotelli, 74), Antonio Cassano (Alessandro Diamanti, 62).
Ireland: Shay Given, Sean St. Ledger, Stephen Ward, John O'Shea, Richard Dunne, Glenn Whelan, Aiden McGeady (Shane Long, 65), Keith Andrews, Damien Duff, Kevin Doyle (Jon Walters, 76), Robbie Keane (Simon Cox, 86).