Leinster 37 Edinburgh 28:Leinster booked a home semi-final in next weekend's Magners League play-offs and sealed Munster's passage in the process with a superb late surge from in a thrilling eight-try contest at the RDS. Edinburgh, who had looked to have squeezed into fourth place, were left with nothing.
Two late converted tries from replacement flanker Stephen Keogh and full-back Rob Kearney helped Leinster secure top spot in the final league table.
The result, coupled with Munster's bonus point loss in Cardiff, sets up an intriguing all-Irish semi-final and Leinster's drive to win this title cannot be questioned after this come-from-behind win.
Edinburgh needed a bonus point victory to stand any chance of reaching the last four, and they struck for two first half tries - through full-back Jim Thompson and winger Mark Robertson - to take a 14-0 lead.
Man-of-the-match Cian Healy touched down to get Leinster off the mark and the right boot of stand-in out-half Isa Nacewa, who landed seven kicks from seven attempts, aided the home side in their comeback.
A Shane Horgan try was brilliantly answered back by quick-fire efforts from Edinburgh replacement hooker Andrew Kelly and Robertson again, edging Rob Moffat's men 28-20 in front.
But, with two Edinburgh players in the sin-bin, Leinster roared back to get the required tries and keep on track for a silverware-winning finish to Michael Cheika's coaching tenure.
Nacewa donned the number 10 jersey, filling in for Shaun Berne who sustained a knock in the warm-up, and energetic Edinburgh made the early running with lock Scott MacLeod prominent.
The first quarter was scoreless, with Leinster struggling to make use of a powerful scrum and Edinburgh lacking the necessary penetration in broken play.
That all changed in the 23rd minute when Edinburgh scored against the run of play. Captain Roddy Grant broke out of the 22, his one-handed offload sent Robertson into open country and with Leinster caught off guard, he was able to put Thompson through for the score.
Godman added the left-sided conversion. Leinster tried to hit back but Brian O'Driscoll was isolated on the Edinburgh 22, the ball was booted downfield and Tim Visser was unfortunate as his own hack on rolled into touch, just metres from the try-line.
But luck was on Edinburgh's side just minutes later as referee Peter Fitzgibbon missed a clear case of crossing and Robertson beat the first tackle to dart clear and all the way to the line.
Leinster belatedly got on the scoreboard, four minutes before half-time, when Jamie Heaslip attacked off the base of a scrum, and his back row colleague Kevin McLaughlin took it on before prop Healy burrowed over from a ruck.
Nacewa kicked the conversion and followed up with a penalty as Leinster ended the half on the attack, but 14-10 in arrears.
They made a lightning quick start to the second period as Nacewa engineered a break from a midfield ruck, cantered through and passed for Horgan to go for the left corner and stretch over under pressure from the covering Thompson.
Nacewa added the conversion for good measure, taking Leinster ahead at 17-14, and a further penalty gave them a six-point cushion.
However, Edinburgh raised their game and Leinster, conquered by Toulouse last weekend, looked tired as great hands from Nick De Luca got his side on the attack and Heaslip was flashed a yellow card for a deliberate knock on.
Visser missed out on a try again as Edinburgh botched an overlap, but Leinster could not hold out and in the 64th minute, Kelly was alert to collect a loose ball off a ruck and muscle over under the posts.
Godman converted and just a minute later, added the extras to Robertson's second try as he sprinted through a gap between Horgan and O'Driscoll.
But the long-time league leaders failed to panic and with McLaughlin, Nathan Hines and Healy providing the power, they got back within scoring range.
Nacewa kicked his third penalty, closing the gap to 28-23, and then prop Allan Jacobsen and number eight Allister Hogg were sin-binned in quick succession for ruck offences close to their posts.
In a nail-biting finish, Leinster drew level when Keogh, supported by McLaughlin, crashed over and Nacewa's conversion edged the hosts ahead.
When Godman's snap drop goal attempt was blocked by Kearney, Leinster sensed blood and the full-back won the race to Hines' hack through to register the bonus point. Nacewa drew over the conversion to complete his impressive 17-point tally.