The Republic of Ireland qualified for the World Cup on an emotional, historic night at Hampden Park after Amber Barrett rose from the bench to settle a nerve-jangling clash in Glasgow.

All the permutations and possibilities of a ridiculously complex play-off system were washed away as Portugal beat Iceland and the Irish prevailed over the Scots to ensure they head to the finals as one of the two best-ranked teams.

Two days ago hundreds gathered for a vigil in Milford, Co Donegal - Barrett's home town - in memory of the 10 people who lost their lives in the explosion at the service station in Creeslough.

Tonight, she wrote herself into Irish sporting folklore, kissing the black armband on her shirt in tribute to those souls after she’d found the net 18 minutes from time.

Scotland threw everything at Vera Pauw’s team in an unbearably tense finale. But this incredibly resilient side would not bend.

They have smashed through a barrier, five years, six months and seven days since they had to make a stand inside Liberty Hall just to get their own tracksuits.

'Respect’, read the slogan on their T-shirts that day. And now? Try ‘History’. ‘Trailblazers’. ‘Icons’.

They are going where no Ireland women’s team have gone before.

Ireland are going to the World Cup.

In his match programme notes Scotland boss Pedro Martinez Losa issued a simple instruction to the home fans: "Be loud". They obliged with a typically committed pre-kick-off Flower Of Scotland that was followed by an immaculately observed minute's silence in tribute to those who died in the explosion in Creeslough, Co Donegal.

Ireland settled well on a chilly night in Glasgow – pressing high and biting at the Scots’ heels.

Katie McCabe’s effort from outside the box was charged down; then Heather Payne pinched back possession and had a pop from range, before a dangerous McCabe cross from the left had to be shunted away by Rachel Corsie.

Their aggression seemed to catch Scotland by surprise as the Irish swarmed all over key trio Caroline Weir, Erin Cuthbert and Sam Kerr. Cuthbert was lucky not to go in the book on ten minutes after taking McCabe out in the middle of the park.

And then, in the 12th minute, Scotland flickered into life with a slick move that ended with Martha Thomas’s effort being deflected on to the bar via the hand of Niamh Fahey. Penalty.

It looked harsh, and Fahey was livid, but Brosnan came to the rescue as she guessed right to bat away Weir’s spot-kick.

Relief for Ireland, but Scotland began to dominate.

They had another penalty shout in the 19th minute when Brosnan collided with Thomas after Kerr’s ball over the top caught the visitors napping. This time referee Esther Staubli – and VAR – waved it away.

As the half wore on the influence of Scotland’s best players increased, while Ireland’s main threats McCabe and Denise O’Sullivan faded under the intense attentions of their opponents.

But when you have a weapon like Megan Campbell’s throw-ins, there’s always hope. She catapulted a huge delivery into the box that bounced into the net without anyone getting a touch, thus being disallowed. Special mention to the ice-cool Sophie Howard who ducked out of the way to allow the ball go straight in – a calculated, but very risky manoeuvre.

The game turned again.

Nine minutes before half-time, Ireland had the chance of the game after McCabe bent in a lovely cross from the left and O’Gorman, with the goal at her mercy, conspired to head it over the bar.

With momentum back with the Irish, Payne sliced over a half-volley following a huge Campbell throw and then yet another big throw sparked an incredible scramble. Fahey’s attempt was headed off the line by Howard, Agg’s effort was saved and then Caldwell’s scooped shot was again stopped by Howard in a breathless three seconds.

Scoreless at the break, and both teams would have learned in the dressing rooms that Portugal had beaten Iceland. Task simplified: victory at Hampden Park would seal a ticket to the World Cup.

The Scots re-emerged with greater purpose. Lisa Evans galloped down the right and dinked in a cross that Agg glanced away; then Weir shanked a shot wide from inside the box. The Real Madrid star showed flashes of her quality, twirling away from pressure in the centre circle before driving forward and testing Brosnan.

In the 62nd minute Weir rode three tackles before slipping it to Cuthbert. Her clever pass to Hemsley had Ireland stretch but the strike was well charged down by the recovering Jamie Finn.

Ireland were toiling. With the game on a razor’s edge, the Scots looked more fluid, more creative.

We need your consent to load this comcast-player contentWe use comcast-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

And then… a 72nd-minute sucker punch. Fahey’s cushioned header found O’Sullivan who threaded a terrific pass through to Barrett – who had come on for Payne. The Donegal woman took it in her stride magnificently before sliding a lovely finish beyond Alexander. Barrett's grandparents are from the village of Creeslough. She was visibly emotional.

The Irish bench exploded with joy, but there was work to do yet. Cuthbert stung Brosnan’s palms with a rasping strike and the Scots piled on the pressure.

There were heroes everywhere for Ireland – the back line was immense. When Howard lopped a header inches wide, their spirit broke. There was simply no way past this Irish team who collapsed in unison at the final whistle.

Mission accomplished. Next stop, Australia and New Zealand.

Scotland: Lee Alexander; Lisa Evans (Christy Grimshaw 66), Rachel Corsie (capt), Sophie Howard, Nichola Docherty; Erin Cuthbert, Sam Kerr, Caroline Weir; Fiona Brown (Emma Mitchell 66), Martha Thomas, Claire Emslie

Republic of Ireland: Courtney Brosnan; Jamie Finn, Niamh Fahey, Louise Quinn, Diane Caldwell, Megan Campbell; Aine O’Gorman, Lily Agg, Denise O’Sullivan, Katie McCabe (capt); Heather Payne (Amber Barrett 66)

Referee: Esther Staubli (SUI)