The visitors enjoyed the majority of possession but it was the Irish who proved the more clinical of the two sides.
While Warren Gatland's Wales made pass after pass in Dublin, they only once looked like crossing the tryline and instead relied on four penalties from Scarlets outside-half Stephen Jones to keep them in the game.
The early stages proved an even affair but the game turned midway through the first half when Lee Byrne was sent to the sin bin.
The Ospreys full back saw yellow for knocking the ball out of the hands of Ireland scrum-half Tomas O'Leary at a ruck on the edge of the Irish 22.
During Byrne's 10 minutes off the field, Ireland claimed 10 crucial points.
In a similar manner to the way they struggled when losing Alun Wyn Jones to the bin against England last month, the 14 men of Wales conceded two tries in a hectic spell.
Earls was the first to cross in the 26th minute following good work from Ireland Test centurion Brian O'Driscoll before man-of-the-match O'Leary send the Irish fans wild.
Ireland's second arrived with the game half an hour old after a powerful charge and deft offload from Paul O'Connell. The impressive O'Leary raced 25 metres and rode the late challenges of Leigh Halfpenny and Shane Williams to give Ireland a commanding 16-6 lead.
Leinster youngster Jonathan Sexton and Stephen Jones traded penalties before the break, leaving Ireland with a 10-point, 19-9 advantage at half-time.
The second-half proved a quieter affair but a second Earls try on the hour mark effectively put the game beyond Wales.
The stunning comeback against Scotland and a near repeat against France a fortnight ago meant Wales always remained hopeful of overturning the deficit but, with the Irish defence looking particularly comfortable, a remarkable Welsh win never looked likely.
Guinness PRO12
Suite 208, Alexandra House,
The Sweepstakes
Ballsbridge, Dublin 4, Ireland