Match ends, Italy 0, Republic of Ireland 1.
Robbie Brady's dramatic late winner sank Italy and sent the Republic of Ireland into the last 16 of Euro 2016.
Martin O'Neill's side knew only a victory would secure a place in the knockout stage in France but had failed to find a way through the Azzurri's defence until Brady headed home Wes Hoolahan's cross in the 85th minute.
That sparked mass celebrations from the Republic players, bench and supporters under the closed roof at Stade Pierre Mauroy, which had largely been taken over by the Boys in Green.
Defeat made little difference to Italy, who already knew they would top Group C and made eight changes ahead of Monday's last-16 match with holders Spain.
But the Republic join them as one of the best third-placed sides - and will face the hosts on Sunday - after one of the most famous wins in their history that started a huge party in Lille.
Ireland strike gold with another late winner
Euro 2016 is becoming known for its last-gasp goals so it was perhaps predictable there would be some late drama as the group stage came to a conclusion.
The army of Republic fans certainly never gave up hope, although it had seemed their side had, again, run out of ideas.
After managing only one shot on target in their first two group games - Hoolahan's goal against Sweden - O'Neill understandably went for a more ambitious approach on an all-or-nothing night for his side.
But with Jon Walters unfit and veteran striker Robbie Keane only having the legs for cameo appearances these days, the only way he could bolster his attack was by calling on Ipswich striker Daryl Murphy, who is at times prolific in the Championship but has never scored in 20 games for his country.
Yet the Republic did look more dangerous, particularly in the first half when Murphy saw a header tipped over and James McClean could, and probably should, have had a penalty when Federico Bernardeschi barged to the ground inside the box.
After the break, Italy had looked far more in control until the final few minutes.
Hoolahan wasted a golden opportunity when he was gifted the ball on the edge of the box, and it looked like the Republic's last chance in France had come and gone - until Brady proved otherwise.
Second-choice Italy still a tough nut to crack
Monday's encounter with holders Spain in Paris was clearly very much on Italy boss Antonio Conte's mind when he selected his side for this match.
That, plus the much-maligned - and soon to be re-laid - pitch in Lille was supposed to give the Republic extra hope of their first win over the Azzurri since their memorable triumph at the 1994 World Cup.
It soon became clear, however, that this second-choice Italy side were determined to keep their side's third clean sheet of the tournament.
Until the very end of the game they largely kept the Republic at arm's length, and despite showing little inclination to attack, also threatened at the other end when Simone Zaza volleyed over just after half-time and Lorenzo Insigne hit the post late on.
Their tournament gets a lot harder from here, however, starting with that rematch from the final of Euro 2012 that ended with Spain running out 4-0 winners.
Man of the match - Robbie Brady
'I am absolutely flabbergasted'
Italy boss Antonio Conte: "[We played] against a side that played a lot of long balls, there were a lot of powerful tackles. The pitch definitely helped them more than us but they put a lot of grit into this game because it was life and death for them.
"Congratulations to the Republic of Ireland because they really wanted to go through and they were rewarded, perhaps more than they deserved, but they were rewarded nonetheless."
Republic of Ireland manager Martin O'Neill: "We deserved to win it. We dominated for periods of the game and played some phenomenal stuff.
"It is a very special evening. To come out of the group that we were in is a great achievement."
Republic of Ireland's Robbie Brady: "I grew up dreaming about this stage and to go and do it in front of my family is the best feeling in the world.
"We need to regroup and go again but I am absolutely flabbergasted by it all. Every single one of the lads were unbelievable tonight."
The stats you need to know
- The Republic of Ireland have reached the knockout stages of the European Championship for the first time.
- There were 40 fouls in this match, more than in any game at Euro 2016 so far.
- This was only Italy's third defeat in 24 group stage games at the European Championship.
- Robbie Brady became only the fifth player to score for the Republic of Ireland at the European Championship, joining Ronnie Whelan, Ray Houghton, Sean St Ledger and Wes Hoolahan.
The Republic of Ireland's game against France will take place in Lyon at 14:00 BST on Sunday, 26 June, while Italy's match with Spain will be at the Stade de France at 17:00 BST on Monday, 27 June.
- 12SiriguBooked at 39mins
- 15BarzagliBooked at 79mins
- 21BernardeschiSubstituted forDarmianat 60'minutes
- 2De SciglioSubstituted forEl Shaarawyat 82'minutes
- 7ZazaBooked at 87mins
- 11ImmobileSubstituted forInsigneat 74'minutesBooked at 90mins
- 16De Rossi
- 22El Shaarawy
R. of Ireland
- 17WardBooked at 73mins
- 8McCarthySubstituted forHoolahanat 77'minutes
- 21MurphySubstituted forMcGeadyat 70'minutes
- 9LongBooked at 39minsSubstituted forQuinnat 90'minutes
- Ovidiu Hategan
- Shots on Target
Second Half ends, Italy 0, Republic of Ireland 1.
Foul by Simone Zaza (Italy).
Jeff Hendrick (Republic of Ireland) wins a free kick on the right wing.
Lorenzo Insigne (Italy) is shown the yellow card.
Substitution, Republic of Ireland. Stephen Quinn replaces Shane Long.
Simone Zaza (Italy) is shown the yellow card.
Foul by Simone Zaza (Italy).
Robbie Brady (Republic of Ireland) wins a free kick in the defensive half.
Goal! Italy 0, Republic of Ireland 1. Robbie Brady (Republic of Ireland) header from the centre of the box to the centre of the goal. Assisted by Wes Hoolahan with a cross.
Attempt saved. Stephan El Shaarawy (Italy) right footed shot from outside the box is saved in the bottom right corner. Assisted by Lorenzo Insigne.
Attempt saved. Wes Hoolahan (Republic of Ireland) left footed shot from the centre of the box is saved in the centre of the goal.
Attempt saved. Aiden McGeady (Republic of Ireland) header from the centre of the box is saved in the top centre of the goal. Assisted by Wes Hoolahan.
Attempt missed. Alessandro Florenzi (Italy) right footed shot from outside the box misses to the right. Assisted by Thiago Motta.
Substitution, Italy. Stephan El Shaarawy replaces Mattia De Sciglio.
Corner, Italy. Conceded by Shane Duffy.
Foul by Lorenzo Insigne (Italy).
Seamus Coleman (Republic of Ireland) wins a free kick in the defensive half.
Andrea Barzagli (Italy) is shown the yellow card.
Stefano Sturaro (Italy) wins a free kick on the right wing.