A prominent Labour critic of Jeremy Corbyn has quit the party with a scathing attack on his leadership.

In his resignation letter, Barrow and Furness MP John Woodcock said Mr Corbyn would pose a “clear risk to UK national security as prime minister”.

And he said that, under Mr Corbyn, Labour was no longer “the broad church it has historically been” and there was little chance of returning it to an “inclusive, mainstream electoral force”.

Mr Woodcock, 39, had been sitting as an independent since having the Labour whip withdrawn in April pending investigation of an allegation of sexual harassment.

He denies allegations over supposedly inappropriate texts and emails to a former female staff member between 2014 and 2016.

In his resignation letter, he dismissed the party’s disciplinary process against him as “rigged” and said there was “clear evidence that the process has been manipulated for factional purposes”.

He accused Labour general secretary Jennie Formby of overturning a previous disciplinary panel ruling and said Mr Corbyn had refused to appoint an independent investigator to rule on his case.

And he said he had obtained emails showing that senior party figures were determined to prevent him standing in future elections as a Labour candidate because of his views on Mr Corbyn’s leadership.

Mr Woodcock said it was “not credible” for him to expect a fair hearing from Labour, and that he would now seek an independent process to hear the case.

It is understood that Mr Woodcock’s resignation means the Labour investigation cannot be concluded.

Labour’s policy on sexual harassment cases states that cases are anonymised before being assessed by a panel of three members of the ruling National Executive Committee.

If this panel judges that there is a case to answer, they refer it to the disciplinary National Constitutional Committee, which is separate from the party leadership.

A Labour spokesman said: “Jeremy thanks John for his service to the Labour Party.”

A former aide to Gordon Brown during his time as prime minister and shadow transport minister under Ed Miliband, Mr Woodcock has been one of the harshest internal critics of Mr Corbyn’s leadership of Labour.

He clashed with Mr Corbyn over his stance on nuclear weapons and anti-Semitism.

And in 2017 he stood for re-election in the Cumbria seat he has represented since 2010, but said he did not believe Mr Corbyn was fit to serve as prime minister and would not countenance voting to put him into 10 Downing Street.

In his letter to Mr Corbyn, he wrote: “I have promised to fight for local jobs, promote a credible alternative government, protect the shipyard and ensure the safety of my constitituents through strong defence and national security.

“I now believe more strongly than ever that you have made the Labour Party unfit to deliver those objectives and would pose a clear risk to UK national security as prime minister.

“The party for which I have campaigned since I was a boy is no longer the broad church it has always historically been. Anti-Semitism is being tolerated and Labour has been taken over at nearly every level by the hard left, far beyond the dominance they achieved at the height of 1980s militancy.

“There is little chance of returning the Labour Party to the inclusive, mainstream electoral force my constituents desperately need. In these circumstances, I can no longer justify engaging in a rigged process to be re-admitted to it.”

Mr Woodcock said he will continue to serve as independent MP for Barrow and Furness and will “work with the Government when it is trying to do the right thing, and will also work with the many good colleagues who are still trying to do their best in Labour”.