Replacements used: Luke McGrath (UCD/Leinster) for Marmion (56 mins), Aaron Conneely (Corinthians/Connacht) for Coghlan (70), Conor Finn (Buccaneers/Connacht) for Daly (74), Peter Reilly (Lansdowne/Leinster) for Furlong, James Rael (Garryowen/Munster) for Scannell (both 76), Shane Buckley (Garryowen/Munster) for Henderson, Jake Cawley (Old Belvedere/Leinster) for Merrey, Jack Carty (Buccaneers/Connacht) for Olding (all 79).
Replacements used: Jimmy Yobo (Aurillac) for Danty (22 mins), Alexandre Derrien (Bourgoin) for Galletier (26), Johan Aliouat (Toulon) for Gayraud (32), Raphael Carbou (Perpignan) for Aliouat (49-53, temp sub), Enzo Selponi (Montpellier) for Laranjeira (52), Jean-Baptise Custoja (Perpignan) for Fidinde, Etienne Quiniou (Dax) for Escande (both 53), Carbou for Kazubek (53-60, blood sub), Carbou for Cotet (60), Khatchik Vartanov (Racing Metro 92) for Poirot (71).
Mike Ruddock’s side were 6-0 ahead at the break and Hanrahan gradually tightened their grip on the game, although Gael Fickou snuck in for the only try with 14 minutes remaining.
But Hanrahan’s final penalty of the afternoon capped off another polished performance from the Irish, who have won eight of their ten matches this season.
They will look back on two frustrating defeats to England, in the Six Nations title decider and in the pool stages here, as the ones that got away.
However, Niall Scannell and his team-mates deserve huge credit for the manner of their performances and will take much from their time in South Africa.
The high intensity and accuracy produced by Ireland in this play-off clash was all the more laudable given that the same fifteen players had started against England just five days ago.
They did not get off to the best of starts at Newlands Stadium, and were made to soak up early pressure from the French with centre Fickou threatening with ball in hand.
There were mistakes from both sides in a nervy opening and a drilled kick to touch from Chris Farrell got Ireland on the move and out of their 22.
Back on the defensive, Farrell’s Dungannon club-mate Peter Nelson did well to ground the ball under pressure from his opposite number Theo Platon after a grubber kick from Fickou.
Hanrahan had the first shot at the posts two minutes later, dropping a penalty from halfway short after strong bursts from Farrell and another Ulsterman Iain Henderson.
In the sides’ Six Nations meeting in Grenoble, France held the edge in the scrum but this time around Ireland had the better set piece structure.
A powerful scrum in the 29th minute earned a penalty shot for Hanrahan who landed the kick from outside the 10-metre line for the lead score.
Winger Barry Daly showed great commitment as he raced up to put a crunching tackle on kick receiver Platon and a subsequent penalty was converted by Hanrahan for a 6-0 advantage.
France were guilty of making too many errors and had nothing to show for their two-thirds majority of possession, lacking the game management and conviction of the Irish.
Des Merrey got one up on his scrum rival Pascal Cotet when he caved in at a scrum. However, the difficult 48-metre penalty was pushed to the right of the target by Hanrahan.
France also tried their luck with an injury-time kick from far out and winger Bastien Fuster neither had the accuracy or distance in his strike.
With their back row particularly effective at the breakdown, Ireland pressed on and got an early reward in the second half as Hanrahan kicked three more points to punish a French offside.
Jack Conan, a key figure in that dominant back row, surged away from a scrum to launch a thrilling attack with Kieran Marmion doing well to support him.
The French, who got the better of Australia last time out, were clearly frustrated as the way the game was panning out.
Ireland’s physicality up front and industry all over the pitch gave France little room to manoeuvre in and as they struggled to secure ruck ball, prop Jefferson Poirot lashed out with a punch.
Referee Francisco Pastrana promptly sent the loosehead to the sin-bin and Hanrahan drove the 29-metre penalty between the posts for a 12-0 scoreline.
Ireland then built some promising attacks with Stuart Olding and Farrell combining well in midfield. A clever run and offload from Hanrahan led to Foster Horan going close in the left corner.
France held out but Alan O’Connor’s blockbusting tackle on Vincent Martin gave the Irish an extra boost.
Henderson and Tadhg Beirne then forced a penalty at a ruck and Hanrahan’s 60th-minute kick stretched the margin out to 15 points.
Ireland had to be on their guard though and after replacement Luke McGrath had a kick blocked down, they held their ground amid a succession of scrums and lineouts.
France did manage to break Ireland’s resistance in the final quarter, moving scrum ball from left to right for their most dangerous back Fickou to muscle his way over from close range.
Replacement Enzo Selponi converted to make it an eight-point game. Hanrahan missed a gilt-edged chance to reply after France went offside from the restart.
But the Kerry native was back on target with a minute to go, taking his tournament tally to 53 points as Ireland signed off in winning style.
TIME LINE: 20 minutes - Ireland penalty: missed by JJ Hanrahan - 0-0; 29 mins - Ireland penalty: JJ Hanrahan - 3-0; 34 mins - Ireland penalty: JJ Hanrahan - 6-0; 40 mins - Ireland penalty: missed by JJ Hanrahan - 6-0; 40+2 mins - France penalty: missed by Bastien Fuster - 6-0; Half-time - Ireland 6 France 0; 43 mins - Ireland penalty: JJ Hanrahan - 9-0; 49 mins - France yellow card: Jefferson Poirot; 50 mins - Ireland penalty: JJ Hanrahan - 12-0; 60 mins - Ireland penalty: JJ Hanrahan - 15-0; 66 mins - France try: Gael Fickou - 15-5; conversion: Enzo Selponi - 15-7; 69 mins - Ireland penalty: missed by JJ Hanrahan - 15-7; 79 mins - Ireland penalty: JJ Hanrahan - 18-7; Full-time - Ireland 18 France 7
Referee: Francisco Pastrana (Argentina)