Edinburgh strengthened their prospects of securing a place in the last 16 of the Champions Cup — and buried Gloucester’s hopes of doing likewise — with this narrow bonus-point victory, but they suffered a series of early setbacks and had to crawl their way back from a 13-point half-time deficit before they pulled away for the win.

That scenario owed much to a surprisingly sprightly performance by a Gloucester side that came to the Scottish capital in the midst of an injury crisis and after four straight defeats. But it also owed more than a little to Edinburgh’s own early profligacy and their inability to nail the telling pass at critical moments.

As well as a scoreline that was mounting against them, there were signs that alarm bells were ringing in the Edinburgh coaching box when they replaced their entire front row after only 30 minutes. Sean Everitt, the head coach, later suggested that there had been an element of pre-planning in the change, but it is hard to imagine he would have ordered it if everything was going swimmingly at that point.

Eventually, it was Edinburgh’s forward power that made the difference as they closed out the game with a blast of late scores. But it was a far from satisfying performance and certainly not one that will have Bath shaking in their boots ahead of their pool 2 clash next weekend.

Edinburgh had been clear favourites in the build-up, but Gloucester ripped the script to shreds with a bold start that featured them winning a midfield turnover, shifting the ball swiftly to the left and sending the wing Josh Hathaway over for a try with only 90 seconds on the clock.

To make matters worse for the Scots, Gloucester extended their lead soon afterwards, when George Barton clipped over an easy penalty after a high tackle.

Gloucester rugby players celebrating the first try of the game during a match against Edinburgh.

Gloucester had a dream start when Hathaway scored his try barely a minute into the game

WM SPORT MEDIA/ALAMY LIVE NEWS

Yet Edinburgh were still finding holes in the Gloucester defence, creating few of their own with powerful runs by their bigger forwards. And at last they managed to make something of the chances they were creating, with Ben Vellacott, who had started his professional career at Gloucester, squirming through some weak tackle attempts to give his side a foothold on the scoreboard with a try after 17 minutes.

Barton added his second penalty on 30 minutes to put Gloucester 11-5 ahead. Immediately Edinburgh made their front-row change. In fairness, they did seem to get a decent nudge on when the packs next came together, but Gloucester still cleared their lines efficiently enough.

Ben Vellacott of Edinburgh Rugby scoring a try during a European Rugby Champions Cup match.

Vellacott goes over for Edinburgh’s first try as they try to rally after Gloucester’s early advantage

JAMIE JOHNSTON/FOCUS IMAGES LTD/SHUTTERSTOCK

Gloucester and their fans would probably have been satisfied, and a little surprised, to end the first half with a six-point lead, but they did even better than that when Charlie Atkinson outpaced the Edinburgh defence as he chased what had looked like a speculative kick and claimed their second try two minutes before the break. Barton’s conversion meant they headed to the dressing room with an even healthier 18-5 advantage.

Facing that deficit, Edinburgh could not afford to slip further behind as the second half got under way. Yet they butchered their first significant opportunity by knocking on at an attacking lineout five metres from the right corner. The pattern of the first period had been that they let Gloucester off the hook too easily, and this was just more of the same.

Edinburgh did finally get their ducks in a row with a period of concerted and error-free pressure just after the 50th minute. It started with a lovely cross-field kick to the right by the fly half Ross Thompson, which set up a series of rucks on the Gloucester line. The play crabbed infield, Edinburgh won a penalty and the low drives continued. Eventually, Gloucester’s resistance ran out and Ewan Ashman powered over for their second try. Thompson’s conversion put them within six points of their opponents again.

Yet no sooner had they put themselves within touching distance than they lost that position, coughing up a penalty at a scrum on their own 10-metre line that allowed Barton to kick another three points for Gloucester.

It had always seemed likely that Edinburgh’s power game would start to pay dividends at some point. Ashman’s try was the first manifestation of that, and they used it to good effect just after Barton’s third strike when they sent Liam McConnell crashing over from short range. Again, Thompson nailed the conversion, bringing them back to within two points of Gloucester at 19-21.

Edinburgh finally got their noses in front for the first time in the 67th minute. Ben Muncaster appeared to be the hero of the moment as he charged over from a lineout drive, but the video referee intervened, suggesting that there had been an obstruction offence in the construction of the score. The review revealed that there had indeed been an infringement, but by Charlie Atkinson. The Gloucester playmaker was shown a yellow card and Muncaster’s try became a penalty try instead.

By now, Gloucester had all but disappeared as an attacking force, but Edinburgh’s lead was only five points, 26-21, so the Scots were still in a precarious position. And the atmosphere in the Hive Stadium became edgier still when Barton kicked his fourth penalty of the evening to cut Edinburgh’s advantage to two points. In the end, it was enough — but only just.