SCOTTISH Labour winning seven seats represents a Lazarus-style comeback given expectations that the party would do well to hold on to the single seat it had won in 2015.

So unexpected was Scottish Labour's success that at the start of the campaign that the party was targeting just three seats – Edinburgh South, East Lothian and East Renfrewshire, the first two of which it won.

The shock additional gains also came against the backdrop of the council elections weeks earlier, when Labour suffered heavy losses to the SNP, including Glasgow council which it had run for decades.

Opponents claimed Scottish Labour was in terminal decline, with the party having lost the right to be heard in the eyes of much of the electorate after the 2014 independence referendum.

With much of the campaign focus on a Tory threat to the SNP, Scottish Labour's chance of taking back more than a handful of the 40 seats it lost to the SNP in 2015 were largely written off.

Ian Murray's decisive re-election in middle-class Edinburgh South, which he was tipped to lose, saw him secure a massively increased majority of 15,514, a dramatic improvement on the 2,637 margin over the second-placed SNP in 2015.

But what's arguably more significant about the Labour gains is that most are in traditional working-class seats, once bastions of the party, such as Kirkcaldy & Cowdenbeath – the former seat of Gordon Brown – and Rutherglen & Hamilton West, as well as Midlothian, a former mining constituency.

The wins in Coatbridge, Chryston & Bellshill and in Glasgow North East also fall into the category of once-safe Labour constituencies the party lost to the SNP in 2015 that have now returned to the fold.

Labour was widely thought to be a busted flush in such areas, with many working-class voters having made a decisive shift towards the SNP after the independence referendum in 2014.

Kezia Dugdale was quick to declare that "Scottish Labour is back", after what was an undoubted triumph for a party that had experienced repeated electoral humiliations at the hands of the SNP for a decade.

Dugdale performed solidly enough during a campaign that was heavily focussed on opposition to a second independence referendum.

However, there's a strong case to be made that Scottish Labour's gains, as in England and Wales, owed more to the UK-wide 'Corbyn bounce' – the surge in support for Jeremy Corbyn. It's something Labour members have claimed was their experience on the campaign trail.

The crowd of about 200 that greeted the UK Labour leader as he spoke in Glasgow's Buchanan Street last week was also an example of him building support for Labour in Scotland.

Ruth Davidson's Tories successfully managed to eclipse Scottish Labour as the main defender of the Union both in last year's Holyrood election and in last week's the General Election. At the same time Labour, basing much of its campaign on opposition to a second referendum, clearly garnered some support for the party, particularly in Edinburgh South, where anti-SNP tactical voting was rife. However, it's more likely that Corbyn's overall UK surge is responsible for the unexpected gains.

The idea of a Corbyn bounce in Scotland was barely discussed during the election campaign, but was one that certainly benefited Dugdale. All of which is somewhat ironic, given her support for Owen Smith, the Welsh MP who sought to oust Corbyn in last year's Labour leadership contest.

The wins for Scottish Labour gives the party a significant voice at Westminster and represents the first signs of electoral recovery in years.

It also almost certainly means Dugdale is safe in her position as Scottish Labour leader for the foreseeable future, a perch that looked decidedly shaky even a week ago. There's unlikely to be any backlash against her, given the gains made by the party. Corbyn is also likely to be content to allow her to claim the lion's share of the credit for the wins.

However, it remains a significant problem for her that Labour is in third place in Scotland behind the Tories, something which it will face an uphill battle to reverse at future elections.

On a practical level for Labour at Westminster Corbyn will be able to avoid the embarrassment of having to appoint English MPs as shadow Scottish ministers. He was forced into such a move when Ian Murray quit as Shadow Scottish Secretary last summer in the failed attempt to oust the Labour leader.

Whether Murray, who is close to Dugdale, returns to the shadow cabinet or whether one of the other MPs takes over will be a talking point. In a television interview early on Friday morning he pointedly refused to answer, three times, whether he would serve in a Corbyn Cabinet.

It's also unlikely there will be any real tensions between Labour at Holyrood and Westminster.