A Scotland Yard diplomatic protection officer was "angry and intoxicated" when he falsely claimed to have witnessed the Plebgate row that led to the resignation of the former cabinet minister Andrew Mitchell, the Old Bailey has heard.

Constable Keith Wallis, 53, had been drinking heavily when he sent an email to his MP in which he lied about hearing Mitchell call police officers "plebs" at the gates of Downing Street.

Wallis listened without expression in the court dock as his barrister pleaded with the judge, Mr Justice Sweeney, to spare him jail, describing the officer's actions as a "sad and solitary piece of grave foolishness" by a man suffering from acute anxiety and depression over the death of his father some years ago.

The prosecutor, Zoe Martin, told the court that Wallis had told police after being arrested at his home in December 2012: "I knew I should have thrown myself under a train yesterday."

Wallis is due to be sentenced on Thursday afternoon after he admitted falsely claiming to have witnessed the confrontation between Mitchell and police officers at the gates of Downing Street.

Described as a loyal foot soldier with 30 years' experience in the Metropolitan police, Wallis was part of the diplomatic protection office that shares an office in Whitehall with some of the group who guarded Downing Street at the time of the Plebgate row.

Wallis was off duty on the day of the incident, the court heard, but had picked up on "office gossip and rumour" about what Mitchell had said when he returned to work the next day.

After finishing his shift at 2pm, Wallis consumed a significant amount of alcohol before returning to his home in West Drayton, west London.

When he returned home he sent an email at 9.52pm to his MP, the then deputy chief whip John Randall, in which he said he was disgusted to hear Mitchell use "gutter language" and show "yobbish and loutish behaviour" towards police officers.

Wallis claimed in the email, which the prosecution said was littered with capital letters and grammatical errors, that he had witnessed the incident along with his nephew, who mistakenly thought that Mitchell was Boris Johnson.

He signed off by saying he did not wish for Mitchell to be sacked over the incident, but that he wished to register his displeasure and realised that "nothing will come of this letter".

But after sending the email events "got completely out of hand" and he did not have the mental capacity to come clean, his lawyer, Patrick Gibbs QC, said.

In a victim impact statement, Mitchell described the effect of the email as "devastating" because it gave traction to the story within Downing Street.

Mitchell said: "On the morning of 25th September 2012 I was called by the prime minister. We had a very difficult conversation during which he told me that he had seen the email and that I would have to go.

"I protested my innocence and after a tense conversation lasting around six minutes he agreed to instigate an investigation through the cabinet secretary, Sir Jeremy Heywood."

He added: "The existence of the emails contributed to my acute demoralisation and sense of isolation. They were therefore a contributory factor in the events which led to my resignation."

Wallis continued to maintain that he had witnessed the incident, even when his claim became central to a Downing Street inquiry into the affair. The court heard that, as the pressure on the officer grew, he even took his young nephew to a meeting with Randall to back up his story.

Wallis only admitted he had not seen the incident when confronted with Downing Street CCTV footage during his first police interview.

The officer was disconsolate and apologetic during two police interviews. "I 100% convinced myself I was there. I visualised myself standing there," he told the interviewing officers.

"I thought in a strange way I was backing up my colleagues. I wasn't. I was doing the wrong thing and it's all exploded. I was doing the wrong thing. I don't know why."

He apologised to all of the parties involved, telling officers interviewing him: "I've let everyone down … All I can say is I'm really, really sorry. Really sorry."

Data obtained from Wallis's mobile phone showed that he was in fact near his home in West Drayton at the time of the row in Westminster. His nephew, who Wallis claimed was with him at the gates of Downing Street, was actually in north London.

The court heard that Wallis had been on restricted duties due to a degenerative medical condition before the Plebgate incident, and that he had struggled to come to terms with the death of his father some years earlier.

His lawyer, Gibbs, pleaded with the court to spare him jail.

"To speak with him now is not really like speaking to an adult at all. It's like speaking to a son who wants above all things to be with his father, only his father is dead and has been dead for some time," he said.

Gibbs said that Wallis wanted the judge to send him to prison because he believed "everyone would be better off without him".

However, he added: "Sentencing him to prison would be to mistake this for what it is not and to look around, rather than directly at, what the medical health experts report as to his state now and his degenerating state at least soon after the time of the email.

"Whatever he might ask your lordship to do, I am going to ask for something different. I'm going to ask he be treated and not just extinguished."