© Getty Images
Ireland headed into the match knowing that they needed to win by more than 20 points to move back above Wales in the standings, and they made a strong start as Paul O'Connell powered over inside the opening five minutes.
The visitors were dominant at the start of the second half as they tried to open up the required gap, resulting in a try for Jared Payne, leaving Ireland and Wales level on points difference.
Ireland had a lineout late on as they tried to keep their title hopes alive, and O'Brien managed to squeeze over after taking the ball from Jamie Heaslip.
The result moves Ireland ahead of Wales, but they can still be caught by England in the final match of the tournament if they beat France by 26 points later.