A teenager accused of murdering a senior civil servant he met via the gay dating app Grindr has told a court he met him on the night he was killed in the hope he would help him pay off a debt.

Ben Bamford, now 18, said he "needed to get as much money as I could" from high-ranking HM Revenue and Customs official Paul Jefferies, 52, who had given him cash before.

Bamford told how Mr Jefferies, who reportedly advised ex-chancellor George Osborne's Treasury team, picked him up in his Audi TT and took him back to his Grade II-listed cottage in Mayfield, East Sussex.

Asked by defence counsel Alan Kent QC why he wanted to meet Mr Jefferies on February 23, Bamford, then 17, replied: "Because I needed to get as much money as I could to pay off this debt.

"He had given me some in the past so I knew he would give me some if I met with him."

Before meeting up with him, Bamford took valium and smoked cannabis.

After kissing on the sofa, Mr Jefferies invited Bamford upstairs to his bedroom where he "got on top of me", he told Lewes Crown Court.

Bamford then said he asked Mr Jefferies to stop but that he carried on having sex with him until Bamford told him he needed the toilet.

Dressed in his boxer shorts, Bamford - who first met Mr Jefferies via Grindr aged 15 in 2014 - said he went downstairs as he "wanted to get away" but found the door locked.

He told the court: "I knew that all my stuff was upstairs, like my phone, so I knew I had to go upstairs at some point.

"I ended up taking a knife. It was on the kitchen side."

Upstairs, as Mr Jefferies was lying naked on the bed, Bamford said he stabbed him, inflicting more than 40 injuries, including slashing his throat.

Asked by Mr Kent what caused him to attack Mr Jefferies, Bamford said: "I don't know. It was just the way I felt at the time."

He denied plotting to attack him and said he had "not properly" known what he was doing at the time. He said it did not enter his mind to dial 999.

Prosecutors claim Bamford set out to rob Mr Jefferies after he built up drugs debts of about £400 and was being pressurised to come up with money.

Text exchanges were read in court between Bamford and a man called Glenn. On the day of the killing, Glenn texted Bamford: "I'm not happy. On my boy's life, I will see you today."

Later, after Glenn told Bamford he was "treating me like a mug", Bamford replied: "I will get it to you. Don't worry."

Bamford, of South Street, Crowborough, denies murder, claiming he was trying to protect himself from Mr Jefferies.

The court heard that after leaving Mr Jefferies for dead, Bamford took his Audi TT car and picked up a friend en route to going to Eastbourne District General Hospital.

Jurors were shown a selfie picture of Bamford flicking his middle finger at the camera while lying on his hospital bed after he was admitted claiming he had self harmed to avoid police involvement over the attack on Mr Jefferies.

Asked by Mr Kent whether he thought he had killed Mr Jefferies, Bamford replied: "I thought he might be but I wasn't too sure."

He handed himself in to police after speaking to his parents, Richard and Annmarie Bamford.

The case continues.