Ireland booked their place in the 2008 Rugby League World Cup in Australia by the most slender of margins after forcing a draw with Lebanon in their final European qualifying group one match.
Lebanon, who were forced to play their home tie at Dewsbury because of the volatile situation in the Middle East, had fought back from 12-4 down at half-time to lead 16-14 with four minutes left.
But substitute Chris Bridge rescued a draw with his second penalty of the match which enabled the Irish to top the group on points difference.
It was the second draw between the two teams but Lebanon were left to rue their failure to post enough points against Russia.
However, the Lebanese will have a chance to claim the 10th place in Australia by entering the repechage.
Ireland set the tone for a bruising encounter in the very first minute when prop Ray Moujalli was rocked back by a crunching double tackle from Mick Cassidy and Eamon O'Carroll, freeing up possession from which scrum-half Liam Finn scored the first try, tapping the ball ahead and getting the vital touch.
Scrum-half George Ndaira, Lebanon's best player by some distance, jinked his way over for a try but the Irish extended their lead on 19 minutes when stand-off Paul Handforth followed up a kick from impressive centre Sean Gleeson.
Both sides had tries disallowed, with Ireland second rower Jed Corcoran brought back for a forward pass while Lebanon centre Hassan Saleh was denied by offside.
Finn converted both Ireland's tries to give his side a 12-4 interval lead but the gap was down to just two points when experienced loose forward Chris Salem forced his way over from close range eight minutes into the second half.
Lebanon consistently let themselves down with their lack of discipline and they were reduced to 12 men on 61 minutes when prop Charlie Nohra was sin-binned for the latest in a series of high tackles.
Another penalty gave substitute Chris Bridge the opportunity to kick Ireland into a 14-10 lead but when full-back Scott Grix marred an otherwise faultless display by fumbling a high kick from Anthony Farah to present centre Frank Samia with an easy try.
That levelled the scores and full-back Toufic Nicholas' second conversion put Lebanon in front for the first time.
The game looked to have slipped away from Ireland but Salem produced an untimely high tackle on Bridge and the Warrington stand-off got up to kick the crucial goal.