Ulster secured a home quarter-final and condemned Leicester to an away tie as they ended the Tigers' unbeaten home run of 25 matches in the Heineken Cup.
It was 9-9 at the break thanks to a hat-trick of penalties from fly-half Toby Flood for Leicester and scrum-half Ruan Pienaar for the visitors.
A Flood penalty and Niall Morris's converted try put Tigers 19-9 up.
But a Pienaar penalty and his converted try levelled matters before his fifth penalty gave Ulster a dramatic win.
When Leicester were 10 points to the good with half an hour remaining it looked as though they would not only end the only unbeaten record in this season's tournament but also book a home quarter-final themselves.
But the Ulster players flew into the hosts in every tackle and at every breakdown to put them on the back foot and enable South Africa scrum-half Pienaar to guide the Irish province to a victory at Welford Road which ensures they qualify as top seeds.
The 1999 champions and 2012 beaten finalists are currently redeveloping their Ravenhill ground so it will hold 18,000 supporters.
They promise it will be ready for the quarter-finals on the weekend of 4-6 April and given the fervour of their fans it is unlikely to be anything other than a sell-out when they host Saracens, who will be the eighth and final qualifiers after Leicester's losing bonus point meant the Tigers finished as the best runners-up in the group stages.
Leicester were on top initially in a brutal encounter with their scrum going well and full-back Mathew Tait, who would later limp off injured, looking lively.
Second row Graham Kitchener nearly added a try to his fine line-out work as he was hauled down just short after a 40m burst, but despite not crossing the line Flood's boot guided Tigers into a 9-3 lead.
However, Ulster marry Irish defiance with a combination of beef and rugby intellect from South Africa and with Pienaar, the brains of their operation, pulling the strings and landing his penalties they pulled level at the break.
Again it was the hosts who began the better after the restart and when Ulster open-side flanker Chris Henry broke early from a scrum Flood restored Tigers' lead, which they soon extended to 10 points.
Tom Youngs went barrelling forwards from a high Flood kick and when the Tigers recycled the fly-half threaded through a precise grubber kick and winger Morris won the race to touch down.
Flood converted to make it 19-9 and surely Leicester were on their way, but Ulster were in no mood to accept defeat and hit back five minutes later when hooker Youngs went off his feet at a ruck and Pienaar found the target with the penalty.
Then came the decisive moment of the game as Pienaar charged down Flood's kick and won the race to touch down, before converting his own score from wide out to make it 19-19.
The game was anyone's and Leicester went close after Flood's superb penalty to the corner earned them an attacking line-out, only for the fly-half to drop a pass five metres from the line as Tigers hammered away.
Ulster once again fought their way back into Leicester territory and Pienaar confirmed his class with a long-range penalty to put the visitors in front.
Leicester had a late scrum in the Ulster half but the visitors won the ball against the head and with it went Tigers' hopes as the Irish province made it six wins out of six and set up what promises to be a lively house warming party at Ravenhill.
Ulster captain Johann Muller: "It seems like it's happening every week, when Ruan scores all the points - he was outstanding.
"We came here to get a home quarter-final. Sarries totally outplayed us last season - they are a great side and don't mind going away to get a result.
"It's two months away and at this stage we will just enjoy the moment. We have not achieved anything yet and there's a huge amount of work left if we are to achieve something."
Leicester boss Richard Cockerill: "We're disappointed with the result, but it was a good game. Ten points up we needed to control the game better but we did not manage the back field as well as we would have liked and they exposed us.
"At the moment it's probably Toulon [away in the last eight], tomorrow it may be Clermont who have an average home record - what is it, 73 games unbeaten?"
"We are in the quarter-finals and we have suffered a lot of adversity [through injuries], so that's not a bad effort from us."
Leicester: Tait; Morris, Smith, Allen, Goneva; Flood, B Youngs; Ayerza, T Youngs, Cole, Slater, Kitchener, Gibson, Salvi, Crane.
Replacements: Hamilton for Tait (38), Mele for B Youngs (69), Hawkins for T Youngs (68), Deacon for Kitchener (46), Mafi for Crane (19), Williams for Smith (80).
Not Used: Stankovich, Balmain, Williams.
Ulster: Payne; Trimble, Cave, L Marshall, Gilroy; P Jackson, Pienaar; Black, Best, Afoa, Muller, Tuohy, Wilson, Henry, Williams.
Replacements: Court for Black (55), Henderson for Tuohy (64), Diack for Williams (55).
Not Used: Herring, Lutton, McIlwaine, P Marshall, Allen.
Ref: Nigel Owens (Wales).