Boris Johnson is resigning as an MP after accusing a Commons investigation into whether he misled Parliament over partygate of attempting to "drive me out".

The former prime minister, in a statement to the media, compared the Privileges Committee probe to a "kangaroo court" as he announced his intention to step down as MP for Uxbridge and South Ruislip.

He said, after receiving a letter from the committee, he believed it was "determined to use the proceedings against me to drive me out of Parliament".

"It is very sad to be leaving Parliament - at least for now - but above all I am bewildered and appalled that I can be forced out, anti-democratically, by a committee chaired and managed, by Harriet Harman, with such egregious bias," he said.

READ MORE: Boris Johnson statement in full as he resigns as an MP

"I have received a letter from the Privileges Committee making it clear - much to my amazement - that they are determined to use the proceedings against me to drive me out of Parliament.

"They have still not produced a shred of evidence that I knowingly or recklessly misled the Commons.

"They know perfectly well that when I spoke in the Commons I was saying what I believed sincerely to be true and what I had been briefed to say, like any other minister."

"I did not lie, and I believe that in their hearts the Committee know it."

Johnson was the first British Prime Minister to be interviewed under police caution over lockdown-breaking parties held on Downing Street. Both he and then Chancellor of the Exchequer, Rishi Sunak, were fined by police.

During the investigation Johnson made several statements in Parliament which were later found to be untrue.

SNP Westminster Leader Stephen Flynn MP said: “Good riddance. No one in Scotland will shed a tear to see the back of Boris Johnson.

"The SNP will be working hard for every vote at the next election, so Scotland can get rid of these rotten Tory governments for good with independence.”

SNP Westminster Deputy Leader Mhairi Black MP said: "Boris Johnson has jumped before he was pushed, and no one in Scotland will be sorry to see the back of him but he has also underlined the weakness of Rishi Sunak, who has no authority over the bitterly divided Tory party.

"Sunak has been utterly humiliated. On the day he was forced to accept Johnson's dodgy honours list to shore up his position, his predecessor has stuck two fingers up at him and reminded everyone that Sunak was unable to take action for fear of a leadership challenge.

"This sordid Tory scandal is yet another reminder of how broken and corrupt the Westminster system is - and why it is essential that Scotland becomes an independent country, so we can escape Westminster control and get rid of unelected Tory governments for good."

Deputy Labour leader Angela Rayner said the British public was "sick to the back teeth of this never ending Tory soap opera played out at their expense" as she urged voters to "turn the page with a fresh start" under a Labour government.

Liberal Democrat deputy leader Daisy Cooper said it was "good riddance" to Mr Johnson.

In his resignation statement, Mr Johnson said: "They know that I corrected the record as soon as possible; and they know that I and every other senior official and minister - including the current Prime Minister and then occupant of the same building, Rishi Sunak - believed that we were working lawfully together."

The resignation follows news of the former Prime Minister's long-awaited resignation honours list and accusations of cronyism after handing peerages, knighthoods and other gongs to his closest allies, including Jacob Rees-Mogg and Priti Patel.

Among the honours were several aides linked to the partygate scandal, including Jack Doyle, who served as communications chief, when the partygate story broke, and Martin Reynolds, the former principal private secretary who sent the infamous "bring your own booze" email to No 10 staff.

Following its release, Downing Street sought to distance current Prime Minister Rishi Sunak from the list.

"He had no involvement or input into the approved list," the Prime Minister's press secretary said.

Boris Johnson's full resignation statement:

"I have received a letter from the Privileges Committee making it clear - much to my amazement - that they are determined to use the proceedings against me to drive me out of Parliament.

"They have still not produced a shred of evidence that I knowingly or recklessly misled the Commons.

"They know perfectly well that when I spoke in the Commons I was saying what I believed sincerely to be true and what I had been briefed to say, like any other minister.

"They know that I corrected the record as soon as possible; and they know that I and every other senior official and minister - including the current Prime Minister and then occupant of the same building, Rishi Sunak - believed that we were working lawfully together.

"I have been an MP since 2001. I take my responsibilities seriously.

"I did not lie, and I believe that in their hearts the Committee know it.

Read more: Johnson warned his taxpayer funded lawyers could be axed if he undermines Sunak

"But they have wilfully chosen to ignore the truth because from the outset their purpose has not been to discover the truth, or genuinely to understand what was in my mind when I spoke in the Commons.

"Their purpose from the beginning has been to find me guilty, regardless of the facts. This is the very definition of a kangaroo court.

"Most members of the Committee - especially the chair - had already expressed deeply prejudicial remarks about my guilt before they had even seen the evidence. They should have recused themselves.

"In retrospect it was naive and trusting of me to think that these proceedings could be remotely useful or fair. But I was determined to believe in the system, and in justice, and to vindicate what I knew to be the truth.

"It was the same faith in the impartiality of our systems that led me to commission Sue Gray. It is clear that my faith has been misplaced. Of course, it suits the Labour Party, the Liberal Democrats, and the SNP to do whatever they can to remove me from parliament.

"Sadly, as we saw in July last year, there are currently some Tory MPs who share that view. I am not alone in thinking that there is a witch hunt under way, to take revenge for Brexit and ultimately to reverse the 2016 referendum result.

Read more: Minister: Covid inquiry will only get evidence that's 'right for it'

"My removal is the necessary first step, and I believe there has been a concerted attempt to bring it about. I am afraid I no longer believe that it is any coincidence that Sue Gray - who investigated gatherings in Number 10 - is now the chief of staff designate of the Labour leader.

"Nor do I believe that it is any coincidence that her supposedly impartial chief counsel, Daniel Stilitz KC, turned out to be a strong Labour supporter who repeatedly tweeted personal attacks on me and the government.

"When I left office last year the government was only a handful of points behind in the polls. That gap has now massively widened.

"Just a few years after winning the biggest majority in almost half a century, that majority is now clearly at risk.

"Our party needs urgently to recapture its sense of momentum and its belief in what this country can do.

Read more: Boris Johnson accuses Cabinet office of 'unacceptable' claims after police referral

"We need to show how we are making the most of Brexit and we need in the next months to be setting out a pro-growth and pro-investment agenda. We need to cut business and personal taxes - and not just as pre-election gimmicks - rather than endlessly putting them up.

"We must not be afraid to be a properly Conservative government.

"Why have we so passively abandoned the prospect of a Free Trade Deal with the US? Why have we junked measures to help people into housing or to scrap EU directives or to promote animal welfare?

"We need to deliver on the 2019 manifesto, which was endorsed by 14 million people. We should remember that more than 17 million voted for Brexit.

"I am now being forced out of Parliament by a tiny handful of people, with no evidence to back up their assertions, and without the approval even of Conservative party members let alone the wider electorate.

"I believe that a dangerous and unsettling precedent is being set.

"The Conservative Party has the time to recover its mojo and its ambition and to win the next election.

Read more: Alison Rowat: Need to phone a friend, Minister? Ignorance is bliss in speeding row

"I had looked forward to providing enthusiastic support as a backbench MP. Harriet Harman's committee has set out to make that objective completely untenable.

"The Committee's report is riddled with inaccuracies and reeks of prejudice but under their absurd and unjust process I have no formal ability to challenge anything they say.

"The Privileges Committee is there to protect the privileges of parliament. That is a very important job. They should not be using their powers - which have only been very recently designed - to mount what is plainly a political hit-job on someone they oppose.

"It is in no-one's interest, however, that the process the Committee has launched should continue for a single day further.

"So I have today written to my Association in Uxbridge and South Ruislip to say that I am stepping down forthwith and triggering an immediate by-election.

"I am very sorry to leave my wonderful constituency. It has been a huge honour to serve them, both as Mayor and MP.

"But I am proud that after what is cumulatively a 15-year stint I have helped to deliver among other things a vast new railway in the Elizabeth Line and full funding for a wonderful new state of the art hospital for Hillingdon, where enabling works have already begun.

"I also remain hugely proud of all that we achieved in my time in office as prime minister: getting Brexit done, winning the biggest majority for 40 years and delivering the fastest vaccine rollout of any major European country, as well as leading global support for Ukraine.

"It is very sad to be leaving Parliament - at least for now - but above all I am bewildered and appalled that I can be forced out, anti-democratically, by a committee chaired and managed, by Harriet Harman, with such egregious bias."