Fourteen-man Ulster booked their place in the Pro12 semi-finals despite their defeat by leaders Leinster in a frantic contest which marked the official opening of the redeveloped Ravenhill.
The losing bonus point secured Ulster's play-off spot as they kept in the game despite Tom Court's early red card.
Rob Kearney was yellow carded in the first half for his high tackle on Paddy Jackson as the fly-half scored a try.
Shane Jennings's second-half try gave Leinster a sufficient lead to hold on.
There were talking points aplenty as Ulster prop Court was sent off after only 16 minutes as both he and front-row colleague Rob Herring combined to tip tackle giant Leinster lock Devin Toner.
Leinster full-back Kearney then looked fortunate to avoid a red card for his neck high challenge on Jackson while Rhys Ruddock could also have been given more than a sin-binning after he tackled the Ulster fly-half in the air in the opening period.
The Leinster try was also laced with controversy as Ulster wing Tommy Bowe appeared to be caught in mid-air before he lost possession as the play was finished off with Brian O'Driscoll's trademark off-load setting up Jennings to score.
Court's red card was Ulster's second sending off in three home games after Jared Payne's dismissal against Saracens in last month's Heineken Cup quarter-final.
Leinster, however, were down to 13 men at one point in that first half after Kearney and Ruddock were shown yellow by English referee Luke Pearce.
Man of the match Jackson scored all Ulster's points, on an emotional occasion as skipper Johann Muller and Court played their last Ravenhill games.
South African Muller is retiring at the end of this season while Court will be moving to English Premiership club London Irish.
Ulster legend Jack Kyle was among the many stars of the past present to see the official tape cutting at the new Ravenhill but he saw Madigan kick Leinster into an early 6-0 lead.
Things went from bad to worse for Ulster as Court was handed his red card as he and Herring produced their dangerous tackle on Ireland lock Toner.
Under the letter of the law, it looked a fair decision and Ulster were soon forced to withdraw number eight Nick Williams in order to send on replacement prop Callum Black.
However, amid further controversy, Ulster were back in the game on 24 minutes as Jackson ran in to score in the corner after he had charged down Madigan's attempted clearance.
Kearney tackled Jackson neck high as the fly-half notched the touch down but the Leinster full-back escaped with a yellow card.
There was also a strong case for a penalty try having been awarded which surely would have resulted in another guaranteed two points, as opposed to Jackson's missed conversion attempt.
Jackson was the wronged party again in the 26th minute as he was taken out in the air by a combination of Zane Kirchner and Ruddock.
The flanker was adjudged the guilty party as he was sin-binned and the first half ended with Jackson and Madigan swapping penalties as Leinster led 9-8 at the break.
Madigan missed two kickable penalties to increase Leinster's advantage after the resumption and Ulster had another escape when Dave Kearney was bundled into touch as he seemed certain to score in the corner.
A penalty apiece from the respective fly-halves kept Leinster 12-11 ahead by the 58th minute but O'Driscoll's terrific off-load enabled Jenning to run over unopposed on 59 minutes after Bowe had lost possession following another controversial mid-air collision.
Ulster outscored Leinster by three penalties to one in the closing 20 minutes but the visitors always looked likely to hold on as home skipper Muller left the field to an emotional reception on 63 minutes.
Nevertheless, the losing bonus point was enough to secure a semi-final spot which could well mean another tussle with their Irish rivals.
Ulster: R Andrew; A Trimble, J Payne, L Marshall, T Bowe; P Jackson, P Marshall; T Court, R Herring, A Warwick; J Muller (capt), I Henderson; R Wilson, C Henry, N Williams.
Replacements: D Cave for L Marshall 57, A Macklin for Warwick 70, D Tuohy for Muller 63, C Black for Williams 19, Williams for Wilson 68.
Not Used: Annett, Doyle, Heaney, McKinney.
Leinster: R Kearney; Z Kirchner, B O'Driscoll, G D'Arcy, D Kearney; I Madigan, I Boss; C Healy, S Cronin, M Moore; D Toner, M McCarthy; R Ruddock, S Jennings, J Heaslip (capt).
Replacements: J Gopperth for Madigan 66, J McGrath for Healy 66, R Strauss for Cronin 66, M Ross for Moore 66, J Murphy for Ruddock 72, L Cullen for Toner 65
Not Used: L McGrath, Fitzgerald.