“We are going to get hammered on defence at the election.” I think I lost track of the number of times people said that before the campaign. But like so many other lazy assumptions destroyed by the past two months, it simply wasn’t true.

Quietly, in fact, the Labour Party has been building credibility on military, security and related matters — just as the Conservatives have seen theirs evaporate, particularly amongst Armed Forces personnel themselves, who are always the hardest to fool.

The challenge now, of course, is to build on that. At the election, the party performed extremely credibly among military areas. Two of the victories that surprised pundits the most — Luke Pollard in Plymouth Sutton and Devonport, Stephen Morgan in Portsmouth South — were in heavily military-focused communities fed up with the effects of cuts and Conservative mismanagement.

Such frustrations may also have helped carry Sandy Martin across the threshold in Ipswich to beat Ben Gummer. With several military units based nearby, Ipswich has a strong veteran tradition and a vocal collection of former military councillors and campaigners.

Even where we did not win in military communities, the Labour Party made dramatic gains. In Aldershot, long considered a Conservative stronghold, the votes of former and current personnel helped former firefighter Gary Puffett to almost double the number of Labour votes. Former military candidates also performed particularly strongly, almost all significantly growing their vote share.

On a purely tactical level, there is much to build on for council elections next year and whenever the next election comes. Labour Friends of the Forces, which relaunched at the beginning of this year and provided support to a number of former military and other candidates during the election, is hoping to dramatically up its game in 2017.

It’s also important, though, to realise that behind all these gains stands some very real substance. Under Nia Griffith as Shadow Defence Secretary, the party has had what one might term a strong and stable policy platform that genuinely makes sense.

Labour has committed to increasing defence spending in real terms to 2 per cent of GDP, ending the messy arithmetic by which the Conservatives massaged the numbers to deceive our allies, if probably not our potential foes.

There’s clearly a lot more heavy policy thinking to be done. In committing to end the public-sector pay freeze, which also affects the armed forces, the Labour manifesto gave real hope to personnel who have all too often felt ignored. There’s much more to be done on a fair deal for families and veterans, ending wastage through contracting out, and building opportunities as well as proper resources for those who do the real work of defending the realm.

The manifesto committed the Labour Party to renewing Trident as the mainstay of Britain’s protection against the latest existential threats, and ensuring the rest of its military was also fit for purpose. The party has also committed to publishing the National Shipbuilding Strategy, which had, bizarrely, gone missing under the Tories.

The aim of a new Labour government will be to make sure military procurement makes sense not just in terms of local jobs, but also in building the lasting industrial base the country needs. Neither will it sacrifice personnel numbers and training budgets to slavish commitment to expensive big-ticket equipment.

The simple truth seems to be that many of the attempts by the Conservatives and right-wing press to label the party — and Jeremy Corbyn in particular — as weak on the topic backfired. Few voters who are also former members of the military, it transpired, like the spectacle of politicians relishing the idea of launching nuclear or conventional strikes.

That was reinforced by the clear lack of content from the Conservatives. Bafflingly, Defence Secretary Michael Fallon — normally a strong performer — decided to dodge the main debates on military and security issues at the Royal United Security Institute to go campaigning in marginal east London constituencies instead.

The result was predictable — a more junior minister who barely knew her brief was trampled over not just by Nia Griffith but also the other parties. What was supposed to be a photo opportunity in Ilford turned into a public relations fiasco — and as we know, strong local candidate Wes Streeting dramatically increased his majority.

It was, I believe, a sign of things to come.

Peter Apps is a Reuters global affairs columnist, an Army reservist and a volunteer co-ordinator at Labour Friends of the Forces.

Come join Labour Friends of the Forces at at Portcullis House at 7pm on Monday 3 July for discussion on the election and its lessons. Sign up details here.