For all the premonitions of woe and electoral collapse, Labour have stormed home in the Oldham West and Royton by-election, which was triggered by the death of Michael Meacher, a well-respected veteran of the Commons. The fear held by many was that this historically safe seat might fall, with Jeremy Corbyn’s disappointing personal ratings and a surge in tactical voting for Ukip risking a severely embarrassing loss for Labour. The worst case scenario was avoided however, and this can only be down to the success and popularity of Jim McMahon, new Labour MP for Oldham West.

With a majority of nearly 11,000 and an increased vote share from the general election in May, Jim McMahon deserves credit for his election victory. A local hero in the community, he led the council at just twenty-eight and is now only thirty-five. Having campaigned on the doorstep for him, I saw for myself the admiration the people of Oldham have for their new MP. “Councillor Jim”, as he is affectionately known, is seen to be an honest, hardworking politician with a real desire to improve the area: he has made his mark on Oldham through a positive contribution to the lives of everyone living there.

Equally deserving of praise is McMahon’s campaign organisation and publicity. By focusing on local issues and his record as a councillor, the team surrounding McMahon were able to compensate for the weakness of national leadership and policy apparent in Corbyn’s Labour. His fellow local party members deserve acclaim for their ceaseless efforts, including successfully marshalling the thousands of volunteers who arrived to lend their help to the by-election battle. Even with a leadership criticised as badly out-of-touch, the Oldham West and Royton CLP stuck to what it knew to be important to its fellow constituents; McMahon’s motivations as a family man featured prominently on leaflets and flyers. In contrast, the Ukip candidate (Jon Bickley) was successfully portrayed as an outsider, “parachuted in” with no local connections whatsoever.

What other factors contributed to the result? It can only be a cause for encouragement that Ukip’s poisonous platform was rejected. The electorate saw no benefit in their obsession with race and origin – rather, they chose the path of community cohesion and co-operation with a compassionate and consensus building candidate. It took less than an hour for Nigel Farage and Paul Nuttall to start spitting tacks, suggesting that there was something amiss in the number of postal votes cast – especially by the British Asian section of the community. Sour grapes like these only serve to underline their defeat – positivity triumphed, thanks to a great Labour candidate backed by an efficient electoral machine.

Those on the hard left who see this result as a vindication of Jeremy Corbyn’s leadership should reconsider. Corbyn was a notable contributor to this by-election victory – by staying away, he prevented McMahon’s own impeccable image being smeared by his national unpopularity. Visiting only once during the entire process – for a photocall – turned out to be a blessing for Labour and Ukip’s attempts to exploit Corbyn’s unpopularity were much muted as a result. Equally, McMahon himself is no fan of the extreme left, having voted for Liz Kendall during the leadership election. His centrist, aspirational and pro-business beliefs led to opposition from the diehard Corbynistas in his constituency party – but he nonetheless comfortably secured the nomination, with his fellow party members choosing ability and electoral appeal over the self-obsessed ideological ‘purity’ that Momentum and the extreme left hold so dear.

Predictions of woe have been utterly refuted; nonetheless, the positivity of this victory must be taken with a small dose of realism. A safe seat since its creation, with a much loved former MP and a personally popular replacement, anything other than a convincing win would have been a sign of something deeply disturbing. Nor can much encouragement be drawn from the significant swing to Labour in the constituency of over seven per cent. It must be remembered that Ed Miliband’s leadership also began with a by-election in a safe seat, Oldam East and Saddleworth. Whilst a ten per cent swing to Labour (and a larger shift away from the Conservatives) was recorded back then, this was simply the start of a trend that was confirmed in 2015; that by only talking to our lifelong supporters and not to swing voters as well, Labour loses exactly where it must win to achieve a majority.

This result must both encourage and warn the Labour faithful if it is to be replicated elsewhere. Whilst safe seats may vote for ever greater majorities, it is the swing voters who will decide who wins in 2020 – not to mention the Welsh Assembly, London Mayoral and Scottish Parliament elections in May. If we are to repeat victories on this scale nationwide, then Labour must attract more than just its core base of support. That reflection however cannot detract from Jim McMahon’s well deserved win. A popular, moderate and competent local devoted to public service, he and the team around him have showed how community engagement and a positive message can triumph, even if the national picture appears bleak.