There is a “soft coup” taking place within the Labour party to overthrown Jeremy Corbyn, the shadow chancellor has said.

John McDonnell, a longtime ally of Mr Corbyn, said the attempt to take down the leader was “being perpetrated by an alliance between elements in the Labour Party and the Murdoch media empire”.

In an article for the Labour Briefing website published on Sunday night he said that the coup was “planned, co-ordinated and fully resourced”.

“It is, both intent on destroying Jeremy Corbyn and all that he stands for,” he said.

To confuse matters, a spokesperson for Mr McDonnell said the day after the article's publication online that it had been written last week and that he now “wants us all to focus on party unity following last week’s by-election results”.

In the piece, Mr McDonnell said the nature of the coup came in the form of a "constant barrage of negative briefings" against Mr Corbyn and the shadow cabinet from anonymous sources within the party, making it impossible for the leader to do his job.

"The plotters are effective in distorting the media coverage because they have extensive contacts and allies in the media, many inherited from Mandelson’s days," he said.

"The professional planning of interventions in which attacks to undermine Jeremy are framed evidences an exceptionally well resourced ‘dark arts’ operation of the old spin school.

"The coup plotters are willing to sacrifice the Party at elections just to topple Jeremy and prevent a socialist leading the Party. It is more important to them that they regain control of the Party than it is to win elections."

As evidence, Mr McDonnell cited a story about leaked internal polling conducted by Labour being framed as the search for a post-Corbyn successor.

The sensational intervention comes days after the Copeland and Stoke-on-Trent Central by-election results.

Labour saw off Ukip in Stoke with a reduce majority but lost Copeland to the Conservatives for the first time in over 80 years.

Mr Corbyn said this weekend that he would stay on as leader despite the "disappointing" result.

The veteran left-winger faced a leadership challenge from MPs Angela Eagle and Owen Smith shortly after the EU referendum result. He saw off the coup with an increased majority of members' and supporters' support compared to 2015, however.

Dave Brown on Jeremy Corbyn Show all 12 1 /12 Dave Brown on Jeremy Corbyn Dave Brown on Jeremy Corbyn Dave Brown Dave Brown on Jeremy Corbyn Dave Brown Dave Brown on Jeremy Corbyn Dave Brown Dave Brown on Jeremy Corbyn Dave Brown Dave Brown on Jeremy Corbyn Corbyn's reshuffle Dave Brown on Jeremy Corbyn Corbyn and the Syria bombing vote Dave Brown on Jeremy Corbyn Corbyn asks questions from the public at PMQs, meanwhile backbenchers plot to oust him Dave Brown on Jeremy Corbyn Corbyn is unavailable to attend the Privy Council Dave Brown on Jeremy Corbyn Conference rejects Corbyn’s call to debate Trident Dave Brown on Jeremy Corbyn At Labour conference Corbyn and McDonnell press for a Robin Hood tax Dave Brown on Jeremy Corbyn Corbyn’s hopes for a ‘new politics’ look optimistic in the face of a media barrage Dave Brown on Jeremy Corbyn Corbyn enters Labour leadership race

A spokesperson for Mr McDonnell said: “This article was written over a week ago in response the intervention from Tony Blair. It was published in print last week and only went online last night.

“However, as John said yesterday he wants us all to focus on party unity following last week’s by-election results.