Robbie Brady scored an 85th-minute winner as Ireland beat Italy 1-0 to progress to the last 16 of Euro 2016.
Ireland managed just a point from their opening two games, meaning that had to beat Italy and hope that Sweden could not match that feat against Belgium.
Italy manager Antonio Conte had made eight changes, and Ireland played with an intensity and intelligence that was sorely lacking in their second game of the tournament when they fell to a 3-0 defeat against Belgium.
Jeff Hendrick flashed an effort wide of the post early on while James McClean had a pretty solid claim for a penalty turned down on the cusp of half-time.
Ireland struggled to maintain their intensity in the sapping heat of Lille, though, and Italy had the better of the second-half with substitute Lorenzo Insigne hitting the post with just over 10 minutes to go.
However, just as it seemed Ireland would leave the tournament, Brady managed to flash a header past Salvatore Sirigu to send the Irish faithful into raptures.
Ireland finished on four points which sees them through with Sweden losing 1-0 to Belgium.
Italy win the group, Belgium come second and Sweden finish last on one point.
Follow Joy Sports on Twitter: @JoySportsGH. Our hashtag is #JoySports