Ireland's 24-9 victory over France means they will face Argentina in the World Cup quarter-finals but they may be without captain Paul O'Connell and star player Johnny Sexton after both left the field injured in Cardiff.
Flanker Peter O'Mahony also departed on a stretcher in the second half and there could be a fourth Irish setback to come after flanker Sean O'Brien punched France's Pascal Pape less than a minute into the match and is likely to face a retrospective ban.
It means Ireland finish top of Pool D but at huge cost, while France go through second to meet reigning champions New Zealand in the last eight.
Ireland Rob Kearney and Conor Murray scored two second-half tries in a pulsating contest at the Millennium Stadium, while Ian Madigan kicked eight points and Sexton six.
Ireland knew victory over France would see them finish top of Pool D and avoid a fiendish quarter-final against reigning champions New Zealand.
Both teams had already qualified for the last eight but there was still much at stake in Cardiff, with the winners set to earn a kinder knock-out clash against Argentina.
Ireland welcomed back Rob Kearney, who replaced Simon Zebo at full-back, while Devin Toner and Cian Healy came into the pack.
France recalled number eight Louis Picamoles and winger Noa Nakaitaci as Les Bleus chased their first win against the Irish in five attempts under coach Philippe Saint-Andre.
French forward Pascal Pape lasted barely 30 seconds before falling to the ground in a heap, after what replays suggested may have been a deliberate punch from Ireland flanker Sean O'Brien.
Pape was banned for 10 weeks in February after causing Ireland's Jamie Heaslip to damage three vertebrae and O'Brien may yet face punishment if his misdemeanour is confirmed.
France's Frederic Michalak and Scott Spedding both missed penalties in the opening 10 minutes, Spedding's effort coming back off the post, but when Ireland's Johnny Sexton was handed an opportunity from the tee, he made no mistake.
Michalak was more precise in open play, dancing his way through the Irish backline, before Spedding drew France level with a driving kick from halfway.
Ireland, however, were enjoying the ascendancy at the breakdown early on and while Sexton struck the post with a drop-goal attempt, play was brought back for the French failing to roll away, and he slotted the penalty for a 6-3 lead.
A grab round the neck from Peter O'Mahony on French hooker Guilhem Guirado allowed Spedding to restore parity again with a penalty, before Ireland fly-half Sexton was hit with a thumping tackle from Picamoles.
It was the second hit Sexton had absorbed in quick succession and it proved too much for the influential number 10, who had to replaced by Ian Madigan after 25 minutes.
Sexton's departure dealt a huge blow to Irish hopes but Madigan showed few signs of nerves, slotting home a penalty to put his side back into the lead.
Ireland should have extended their advantage before half-time as Tommy Bowe burst through the French line but as he played what looked like a try-making pass, Keith Earls spilled the ball with the line at his mercy.
France finished the half the stronger and Ireland had another injury concern on the stroke of half-time as captain Paul O'Connell had to be carried off on a stretcher.
INTRO: Ireland overcame an injury to star fly-half Johnny Sexton as Joe Schmidt's side took a 9-6 half-time lead against France in Cardiff.
Sexton had to be replaced in the 25th minute following a thundering hit from French forward Louis Picamoles but Ireland responded and should have scored a try when Keith Earls fumbled with the line at his mercy.
France's Scott Spedding kept his side in touch with two penalties while two kicks from Sexton, and another from his replacement Ian Madigan, put the Irish ahead at the break.
With the players already down the tunnel, O'Connell, punching the turf in frustration, left the field wearing an oxygen mask and to a standing ovation from the Irish fans, who must have wondered if they would see their captain again this tournament.
Ireland stormed out the blocks after the restart, however, as Robbie Henshaw raced past Mathieu Bastareaud in midfield before freeing Bowe and then Kearney out wide.
France recovered to force the ball into touch but their resistance was short-lived as Kearney crashed through Michalak from close range to touch down the opening try.
Madigan sent the conversion wide and, as the game approached the hour-mark, O'Mahony was the latest Irish casualty, going off on a stretcher after a robust Pape tackle.
France piled forward in search of a try to level the match but Ireland defended their line resolutely before hitting their opponents with a score of their own in the 72nd minute.
Devin Toner made the initial break and while hooker Rory Best was denied on the line, Murray slammed the ball against the base of the post to put the result beyond doubt.
Madigan added the extras and then kicked a penalty with four minutes to play as Ireland sealed a gutsy win in the face of steepest adversity.