Ireland ended Scotland's hopes of the Six Nations title with a 27-24 victory at Murrayfield in a thrilling encounter on Sunday.
Johnny Sexton's penalty shortly before full-time ended the contest after the Scots had fought back from 24-10 down to level at 24-24 with less than 10 minutes remaining.
Ireland now have six successive wins over the Scots.
Ireland, who have lost to both Wales and France, end their tournament against England next Saturday with the Scots hosting Italy although they still have to play France as well.
"We're just letting in soft tries, which is not acceptable at international level, and it is a little frustrating as we dominated the game," said a relieved Ireland captain Sexton.
"But, if we can finish second after a poor start to the Six Nations, we'll be happy."
Ireland started well putting together several good phases in their first attack getting close to the tryline.
The Scots were probably relieved to just concede three points from the boot of Johnny Sexton.
Ireland came away wth a try from their next foray into Scottish territory.
Sexton's crossfield kick patted back by Keith Earls inside the goal line area despite the attention of Stuart Hogg and Chris Harris -- for Robbie Henshaw to touch down.
Sexton failed to add the extra two points with his conversion coming back off a post.
Finn Russell got the hosts off the mark in the 12th minute with a penalty for 8-3.
The Irish had the upper hand in terms of territory but again they failed to hammer it home coming away with nothing when penalised close to the tryline.
The Scots moved ahead for the first time in comic scrappy fashion.
Hogg charged down a Garry Ringrose kick and running on to try and gather it, the bounce of the ball cannoned off his chin.
Hogg prodded the ball inside into the Irish 22 with Russell running hard to get to it.
He got a boot onto it which Ireland wing James Lowe tried to catch but inadvertently patted it into a grateful Russell's hands who ran over to touch down for his seventh try for his country.
Russell converted for 10-8.
- Sexton boot -
Sexton put Ireland back into the lead with a penalty for 11-10 with Russell slapping his hands in frustration after he missed an opportunity to nose the Scots back in front.
Sexton made no such mistake as on the stroke of half-time he added another penalty to give the Irish a 14-10 lead.
The visitors came out of the blocks firing at the beginning of the second-half and Tadhg Beirne forced his way over to touch down.
Sexton wisely added the extras as quickly as possible for 21-10 as Hogg asked referee Romain Poite to review the decision claiming Hamish Watson had got his arm under the ball as Beirne went over.
Sexton put the Irish two converted tries ahead in the 55th minute with a penalty for 24-10.
Scotland head coach Gregor Townsend rang the changes then and one of those he sent on, Huw Jones, made his mark within five minutes.
The 27-year-old centre exposed Lowe's weakness in defence in brushing him and Hugo Keenan aside and then broke Jamison Gibson-Park's tackle to go over.
Hogg added the conversion for 24-17 to set the game up perfectly with 20 minutes remaining.
Lowe's travails carried on apace as with Ireland in good field position he sent a pass into touch well out of a despairing Ringrose's grasp.
Scotland camped inside the Irish 22 with the visitors being penalised on several occasions.
At one point Poite spoke with Sexton and had to call him back telling the 35-year-old fly-half as he turned away "don't be scared" to talk to me.
Pressure told eventually with Watson squirming over showing great strength to touch down -- Hogg added the conversion to make it all square at 24 apiece with just over five minutes remaining.
However, Sexton's cool head saw the Irish inch 27-24 ahead converting a penalty from the touchline and they held on for a much-needed win.