Joey O'Brien was the Shamrock Rovers hero, scoring their 13th spot-kick, to edge a quite incredible penalty shootout on a rainy night in Tallaght.
As unlikely as it sounds, all Rovers' penalty takers – 13 of them – scored, with the exception of Jack Byrne.
Both goalkeepers took and scored penalties, with O'Brien converting after Alan Mannus, who got near none of the previous spot-kicks, saved from Eemeli Raittinen.
And O'Brien, a veteran who had a fine career in England but says it feels special playing for his local club, coolly put Rovers into the second qualifying round of the Europa League to restore a bit of pride after a poor eight days for the League of Ireland.
Dundalk exited the Champions League, Derry went out of the Europa League after extra time, and so did Bohemians, on penalties, despite a valiant performance earlier today in Hungary.
Rovers were not at their best yet again, but they will park any concerns for now and reflect on a crazy night in Dublin that was crying out for a crowd of supporters to revel in it.
Rovers had gone behind through an early penalty and went behind again in the second half, but equalisers from Graham Burke and Pico Lopes kept them in it. They had to play extra time with ten men, but somehow forced penalties, and somehow survived them.
They really rode their luck in the penalty shootout, both Daniel Lafferty and Aaron McEneff's penalties just about scraping home, before Mannus finally saved the 13th Ilves penalty.
The visitors stole a hugely controversial lead ten minutes in, the ball looking to strike Joey O'Brien on the face, but the Slovakian referee Michal Ocenas inexplicably pointed to the spot, with Rovers players enraged.
Lauri Ala-Myllymaeki converted and, with the rain falling remorselessly, it was looking a little cloudy for the Hoops.
Aaron Greene should have equalised on 13 minutes but, from a brilliant Finn cross, his shot was saved at close range by Mika Hilander.
From the resulting corner, Aaron McEneff waited patiently to use the weight of Jack Byrne's pass, but his drive pulled wide.
For Rovers' equaliser, again the industry of Finn, who was quiet Friday and substituted off against Shelbourne, was key. He won the ball back and found Burke, who has a habit of scoring stunners in Europe, and did again as he curled a gorgeous strike home from the edge of the box.
Twenty minutes in, Byrne fouled, a deflected Burke drive forced into a parry for another corner.
After excellent passing involving Lopes, Finn, Burke and Byrne, Burke went over in the box but looked fortunate not to get booked for diving as Rovers pleaded for a penalty of their own.
The hugely influential Preston loanee then drove over, Rovers smelling blood.
By the half-hour mark, it was hard to envisage anything other than a Rovers win, with the Hoops dominant and looking sure to score more goals, and they nearly got one as Byrne forced another Hilander save after availing of acres of space and the ball from Burke.
To be fair to the Finns, they did pose a threat, and Joey O'Brien used all his experience to slide across and prevent a probable goal from Jair, who had stolen in at the back stick.
Byrne and Burke were pulling the strings, the former finding Neil Farrugia whose cross was read by an Ilves defender, but Burke pounced and forced another corner two minutes shy of the break.
Little of note happened in the opening 15 minutes of the second period, but Ilves would have gotten confidence as Rovers failed to create a real chance.
The Finns duly took a shock lead on 62 minutes. Excellent play down the right from Felipe Aspergren preceded a neat pass inside and Joona Veteli finished with admirable precision from the edge of the box.
Rovers started to dominate but after an excellent Jack Byrne corner-kick delivery, Pico Lopes failed to properly connect and the chance was gone.
Substitue Dylan Watts then forced a comfortable Hilander save with the clock showing 20 minutes left.
Byrne and Lopes combine time and time again from set-pieces, the latest on 77 minutes as the Cape Verde international somehow hooked home the Dubliner's corner with a clever back-flick.
Rovers' task was rendered much harder with two minutes left as Liam Scales picked up a second yellow card, and both of them looking warranted, in relatively quick succession.
Naatan Skyttae tried to break and Scales cynically put his arm across him, betraying his experience at a crucial point in the tie.
Extra time, and half an hour with ten men, meant a long night for the Hoops and they looked in big trouble in the first period when Aaron McEneff's back-pass was picked up by Alan Mannus.
From the free-kick, Lopes brilliantly blocked Tuure Siira's shot on the line.
Rovers could have done with their home fans in their time of need and they had them, to an extent: in the second half of extra time, around a dozen Hoops fans, standing on the outside wall, chanted as if they had been allowed in.
They even managed to light a flare five minutes into the second period of extra time.
The Hoops defended gamely, in particular Lopes, who was a lion at the back as they desperately sought penalties with Ilves struggling to create much despite their extra man.
However, Mannus was scrambling with two minutes left as the strapping Diogo Tomas headed just wide.
The drama was only beginning.
Shamrock Rovers: Mannus; O'Brien, Lopes, Scales; Finn, Byrne, O’Neill, McEneff, Farrugia (Williams 78); Burke (Watts 64), Greene (Lafferty 104).
Ilves: Hilander; Tomas, Miettunen Almen; Jair, Tamminen (Mommo 102), Aspegren (Arifi 111), Veteli (Sira 83), Skytta, Mettala (Raittinen 79), Ala-Myllmaki.
Referee: Michal Ocenas (Slovakia).