Sir Keir Starmer’s top spin doctor has quit after Labour suffered another poor by-election result in which the party lost its deposit.

Ben Nunn announced he was stepping down as the opposition leader’s director of communications, after the party trailed in fourth behind the Green Party in the Chesham and Amersham poll.

The departure of the top aide represents another blow to Sir Keir after Labour picked up 622 votes in the by-election securing just 1.6% of the vote – down from 12.9% at the last general election.

It follows the party’s crushing defeat last month when Labour lost its heartland seat of Hartlepool to the Tories, triggering bitter recriminations against the leadership.

Mr Nunn was said to be quitting to pursue other projects rather than as a direct response to the poor electoral showing, and he continued to support Sir Keir.

In his departure email to staff, Mr Nunn wrote: “I remain as convinced today as I ever have been that he will be a great prime minister and make this a better, stronger, more prosperous country.

“The decision to step down has been one of the most difficult decisions I’ve ever had to take.”

More on Conservatives

Having worked together since 2017, Mr Nunn was with Sir Keir when he was shadow Brexit secretary and helped his successful campaign in the race to replace Jeremy Corbyn as leader.

Deputy communications director Paul Ovenden is also standing down, but his departure is understood to be because of family reasons and unconnected to political events.

The by-election on Thursday saw the Conservative stronghold in Buckinghamshire fall to the Liberal Democrats.

Please use Chrome browser for a more accessible video player

Davey takes hammer to ‘Tory blue wall’

The party’s newest MP Sarah Green overturned a 16,000 majority to win Chesham and Amersham by 8,028 votes, which had been Tory-held since its creation in 1974.

The Greens came in third, with Labour lagging behind in fourth.

In Mr Nunn’s leaving message, he added: “I’ve worked in politics for about six years now and in that time I’ve worked through the junior doctors’ dispute, EU referendum campaign, a leadership contest, Brexit, a general election, another leadership contest and a global pandemic.

“I’ve had the opportunity to learn and experience so much. Now is the chance for me to go forward and do something different.”

Please use Chrome browser for a more accessible video player

‘By-election was a disappointing result’

Meanwhile, Conservative Party co-chair Amanda Milling has acknowledged that the humiliating defeat in Chesham and Amersham was “a warning shot”.

The HS2 rail line being built through the constituency was a major issue in the campaign, as was the proposed planning reforms that have sparked fears about building in the countryside around the seat in the Chilterns.

In the wake of the loss, Boris Johnson has denied the Tories were neglecting southern parts of England in favour of its new northern seats .

The prime minister admitted his party had suffered what was “certainly a disappointing result”, but he pointed to “particular circumstances” in the constituency.