Leicester's fans came here with their heads full of a dream and a nightmare. The latter was that their team would lose and London Irish would win at Sale and that the Tigers – twice European champions – would fail to qualify for the Heineken Cup for the first time. Two minutes into added time, that was the position. Then Tom Varndell ran in a beautifully executed try to win the match and the Tigers were not only in Europe but into the top-four play-offs with a chance of defending their Premiership title. From nightmare to nirvana.

The ball for the crucial try, with Harlequins leading 28-24, flashed to Varndell on the left touchline. Already the scorer of a high-quality try in the first half, Varndell had the season – this troubled debut for Leicester's head coach, Marcelo Loffreda – in his hands. He chipped towards the posts, scorched past Quins' full-back, Mike Brown, and got the bounce he wanted. Andy Goode converted and Leicester leapfrogged Sale and Quins into fourth place to earn a semi-final at Gloucester next Sunday. The sixth-placed finish for Quins' impressive young side may yet see them into the Heineken Cup too; they have to wait until 25 May, to see if Worcester win the European Challenge Cup and restrict the qualifiers through league positions to the top five.

"That's what you need in games like this, a guy with the quality to find an opportunist try," said Martin Corry, Leicester's captain, of Varndell. "He's such an asset to us."

Those charged with presiding over Tigers' assets were at their full complement in the directors' box, with the exception of Sir Clive Woodward, a non-executive board member since last year. Here were the would-be executioners if Loffreda was to pay for Tigers' mixed results with his job. Afterwards the Argentinian thanked the chief executive, Peter Wheeler, for his support. "I've been in other situations with a lot of pressure and in the end it's about how much pressure you put on yourself," Loffreda said. "I tried to be calm and at half-time [when Quins led 21-12] told the team to be patient."

Leicester had lost three home league matches this season. A fourth looked eminently possible after the first half. There were two tries to each team in the opening quarter: Brown ran on to the softest of dabs under the posts by Chris Malone, his fly-half, after the visitors – seeking a first league win here since 1997 – had gone through a dozen phases. Will Skinner only missed a second when he stumbled under Harry Ellis's chasing lunge, then Leicester got their first through Ben Herring from a line-out.

Geordan Murphy sent Varndell scooting around Brown but Quins came back, Danny Care fashioning a try for Skinner. After 31 minutes Nick Easter flopped over a ruck and Leicester had a shot at taking the lead at 15-14. Inexplicably, Goode kicked for touch; the line-out came to nothing.

Yes, Leicester's thinking was muddled. At a ruck just outside their 22 three minutes into first-half added time the ball squirted out and sat sunning itself for a couple of seconds. Tom Williams, the left wing for Quins – who were down to 14 with Chris Robshaw in the bin – ran in, hacked on and scored.

Goode missed five kicks and Care outplayed Ellis royally, but Johne Murphy took Goode's lobbed pass in the 43rd minute and Jordan Crane, the No 8, went over for Leicester's bonus-point try after 68 minutes, either side of Williams' second try from a cross kick by Malone, who also kicked four conversions in a match of no penalty goals but the most wonderful theatre.