Conor Murray, Jacob Stockdale and Keith Earls crossed for tries as Ireland got up and running in the Six Nations at Murrayfield.
Ireland hit back following their defeat to England with a 22-13 victory over Scotland in a pulsating Six Nations showdown at Murrayfield on Saturday.
The defending champions were bullied by Eddie Jones' side in Dublin last time out but responded impressively to deny Scotland a record-equalling eighth consecutive home victory in the tournament, despite losing Johnny Sexton to injury in the first half.
Conor Murray capitalised on a mix-up between Tommy Seymour and Sean Maitland to score the opening try after Greig Laidlaw put Gregor Townsend's side in front, while Jacob Stockdale added a second for the visitors.
Stuart Hogg went off with a shoulder injury in an open first half, yet a first international score from Sam Johnson - converted by Laidlaw - reduced the deficit to 12-10 at the break.
Joe Schmidt's men were not to be denied a fifth win in Six Nations matches against Scotland, though, with Joey Carbery - standing in for the talismanic Sexton at fly-half - laying on a try for Keith Earls and also scoring five points with the boot.
Laidlaw added another penalty midway through the second half, but that was all Scotland were able to muster after the break as they failed to build on an opening win over Italy.