The match, which ended Scottish Six Nations title hopes, ebbed and flowed but the home side will rue a dreadful start.
They outscored the Irish by three tries to two but Johnny Sexton’s boot proved decisive. The old warhorse kicked five from five penalties, including a decisive effort from wide on the left with five minutes left on the clock.
Finn Russell, Huw Jones and Hamish Watson touched down for Scotland but they were always chasing the game.
Ireland’s win means they edge ahead of Scotland for the first time in the fixture’s storied history. The visitors now lead 67-66, with five matches drawn.
Stuart Hogg, the Scotland captain, had spoken before the match about the importance of the first 20 minutes and he must have been horrified by the way Scotland started.
The home team looked half asleep as Ireland tore into them from the get-go. James Lowe sped down the left flank and made good yards before offloading to Sexton. The Ireland captain looked to be in for an early try but Sam Johnson just managed to haul him back.
The danger was only delayed. Ireland built the phases, pressing hard close to the Scottish tryline and when Russell was penalised for not rolling away at the ruck Sexton took the three points.
It seemed scant reward for a period of sustained Irish pressure but the visitors didn’t have long to wait for the opening try.
The Scots were the architects of their own downfall, ceding possession by losing their lineout. But it required a delightful crossfield kick from Sexton to create the score. The ball bounced high in the Scottish in-goal area and Hogg, Chris Harris and Keith Earls all leapt skywards. None of them could get clean hands on it and Henshaw pounced, diving on the loose ball and getting enough downward pressure for the try.
Sexton struck the post with the conversion but Scotland were 8-0 down after eight minutes and looking a tad bewildered.
George Turner shook the home side into life with a good carry and he was supported ably by Hamish Watson and Johnson and when Tadhg Furlong was punished for not rolling away, Scotland had the chance to put some points on the board. Russell duly delivered, knocking over the penalty.
But Ireland still held the whip hand and looked poised to score their second try. Sexton kicked to the corner after Harris was caught offside and the visitors turned the screw. They were inches from the Scottish line but the home pack managed to repel them and win the penalty. It was a big moment for Townsend’s side.
Russell’s boot helped relieve the pressure and Scotland managed to haul themselves back into the game with a 27th minute try which owed much to the footballing skills of Hogg and Russell.
It began with Ireland winning turnover ball but when Garry Ringrose tried to clear, his kick was charged down by the Scotland captain. Hogg hacked the ball on despite the efforts of Ringrose to haul him back illegally.
The ball broke to Russell who kicked it over the head of Lowe, and then collected smartly before dotting down. It was a neat bit of improvisation from the Scottish fly-half and he converted his own try to give Scotland an unlikely 10-8 lead.
It didn’t last long. Scotland lost another lineout and were penalised at the breakdown, offering Sexton the chance to kick Ireland back in front.
Another unforced error, this time by Ali Price who was caught offside, presented Ireland with another penalty opportunity and Sexton made it 14-10 to the visitors on the stroke of half-time.
Ireland were quick out the traps at the start of the second half and they didn’t take long to increase their lead. A period of sustained pressure ended with Beirne borrowing over for the try. Sexton converted and then added another penalty a few minutes later to make it 24-10.
Scotland now had a mountain to climb and looked to the bench for help. Grant Gilchrist and Jones entered the fray and it was the latter who gave Townsend’s men a glimmer of hope with a superb score. It was a fine backs move and when Hogg passed to Jones, the Glasgow centre cut inside and powered over the line despite the best efforts of Lowe.
Hogg took over kicking duties and despatched the conversion to reduce Ireland’s lead to seven points going into the final quarter.
Russell had sustained a head knock and his departure necessitated a reshuffle in the Scotland backs, with Hogg moving to stand-off, Maitland switching to full-back and Darcy Graham coming on on the wing.
It was all change in the pack too, with Scotland’s sub scrum-half, Scott Steele, having to deputise at flanker as injuries took their toll.
Time was ebbing away for Scotland and they redoubled their efforts accordingly. Hogg prodded and probed but his kicks were either too long or easily read. The pack picked up the weight and increased the pressure close to the Ireland line and the Scots finally got their rewards when Watson showed terrific strength and determination and looked to have forced his way over. Referee Poite delayed a decision until his broken whistle had been replaced but after watching the replay he awarded the try.
Hogg converted and suddenly it was 24-24 with six minutes left.
But, just as they did in the first half, Scotland shot themselves in the foot almost immediately.
Ali Price’s kick was charged down by Ryan Baird and though the Scotland scrum-half was able to regather he was penalised for holding on.
That allowed Sexton a pot at goal four metres in from the left touchline and the Ireland captain did what he’d done all afternoon, kicking the penalty straight and true.
There was no way back this time for the Scots.
Scorers. Scotland: Tries: Russell, Jones, Watson. Cons: Russell, Hogg 2. Pen: Russell.
Ireland: Tries: Henshaw, Beirne. Con: Sexton. Pens: Sexton 5.