Cardiff Blues boosted their bid for a place in the Pro12 play-offs as they fought back to beat Ulster at the Arms Park in their second successive win there.
The visitors were 8-0 ahead thanks to Ruan Pienaar's penalty and Robbie Diack's try.
Two first-half Dan Parks penalties gave the hosts hope.
Then tries from Parks and Tom James and Parks' conversion and penalty were enough to see off the visitors.
Ulster's second-half points also came from Pienaar's boot as the Blues followed up their win against Connacht in the Pro12 with another win over Irish opposition.
Number eight Xavier Rush - who spurned a chance to play for Ulster this season - was the game's outstanding performer as he provided reminders of the sort of form that he used to display before the Blues moved to Cardiff City Stadium.
Parks also underlined his tactical value with some sublime touchfinders while Pienaar underlined his credentials behind a battling Ulster pack.
However, the Blues ended with the upper hand after falling behind.
Ulster started in more impressive style as they held firm against the hosts' opening salvos.
Pienaar opened the scoring with a 12th-minute penalty and when the visitors had their chance to extend the lead, they took it.
Number eight Robbie Diack chased hard after the Blues flapped back possession at a defensive line-out.
The ball evaded wing James and Diack had the momentum in his foot-race against Wales scrum-half Lloyd Williams to claim the score.
Parks hit back with a penalty before he and Pienaar exchanged penalties.
The ex-Scotland fly-half then pounced for the Blues' first try.
Full-back Ben Blair was dragged down inches short of the line, but the Ulster defence was absent as Parks picked up and touched down in the corner.
Having had a quiet opening period, Gavin Henson displayed his talent with a well-timed short pass to midfield partner Gavin Evans.
James was then on hand to finish off a move that had the Ulster players complaining Henson's pass was forward.
Parks converted, but was unable to punish opposite number Ian Humphreys' one-handed knock-on of an inside pass that led to the Ulster fly-half being sin-binned.
However, Park and Pienaar were both on target with their next shots at goal.
A Chris Czekaj knock-on under a high ball denied James another score as Irish referee George Clancy called play back.
And Parks was again off target before he and Pienaar again exchanged penalties to bring the scoring to a close.
Cardiff Blues: Ben Blair; Richard Mustoe, Gavin Evans, Gavin Henson, Tom James; Dan Parks, Lloyd Williams; John Yapp, Ryan Tyrell, Scott Andrews, Cory Hill, Paul Tito (capt), Michael Paterson, Martyn Williams, Xavier Rush.
Replacements: Replacements: Chris Czekaj for Blair (61), Richie Rees for L Williams (52), Rhys Thomas for Tyrell (61), Ma'ama Molitika for Hill (54).
Not Used: Ryan Trevett, Ryan Harford, Macauley Cook, Ceri Sweeney.
Ulster: S Terblanche; C Gilroy, N Spence, P Wallace, I Whitten; I Humphreys, R Pienaar; T Court, N Brady, J Afoa, L Stevenson, D Tuohy, C Henry (capt), W Faloon, R Diack.
Replacements: A D'Arcy for Terblanche (61), M McComish for Humphreys (75), P McAllister for Court (53), A Kyriacou for Brady (66), P Marshall for Diack (61).
Not Used: Macklin, Barker, Danielli.
Referee: George Clancy (IRFU)
Assistant Referees: Gwyn Morris, Jon Mason (both WRU)
Citing Commissioner: Gwyn Bowden (WRU)
TMO: Paul Adams (WRU)