Amlin Challenge Cup finalists Cardiff Blues snatched a late win against Munster but it was not enough to clinch a place in the Magners League play-offs.
Leigh Halfpenny's injury-time penalty claimed a seventh straight win for the Blues. But Munster's losing bonus point meant they claimed the fourth and final place in the play-offs ahead of the Blues.
Jamie Roberts scored the game's only try yet the Blues trailed 12-10 at the break following four O'Gara penalties.
Blair missed twice before converting the third to open the scoring on 15 minutes only for O'Gara to swiftly cancel it out with his first attempt.
The Blues finally cut loose on 25 minutes through Roberts. Casey Laulala drew in the defence before Wales centre Roberts barged through two tacklers from close range. Blair converted but the Blues failed to build on the 10-3 lead.
They were guilty of being over-ambitious inside their own half, perhaps with an eye on pushing Munster out of sight of a losing bonus point, and instead handed the points on a plate to O'Gara. The Ireland fly-half duly accepted to nudge Munster ahead just before half-time.
The Blues looked to play a more territorial game in the second half but again failed to capitalise when Munster were reduced to 14 through Marcu Horan's yellow card.
Instead it was Munster who came closest to scoring, O'Gara missed with a ling range penalty while his scoring pass to De Villiers was ruled forward.
Roberts and Laulala combined again before Martyn Williams kicked ahead for replacement Dafydd Hewitt to chase but James Coughlan won the foot race.
The chance finally fell to Halfpenny as time ran out and the Wales wing smashed home the winning kick from 55 metres to at least end the league campaign on a winning note.