A Canary Wharf lawyer accused of having a stash of indecent pictures told jurors his “devastating” HIV diagnosis drew him into hosting drug-fuelled sex parties at his luxury flat.

Tim Varchmin, 44, a former senior lawyer at Barclays, was allegedly caught with images and video clips of children on his computer and mobile phone in October 2014.

When police raided his home in Lancaster Gate, west London, they also uncovered crystal meth on a glass coffee table next to a crack pipe, jurors were told.

Varchmin, originally from Hamburg, denied any of it was his, claiming he would invite men for “chem-sex” parties and give them free rein to do what they wanted, the Old Bailey heard.

Giving evidence, he became tearful when he described finding out he had a particularly drug-resistant strain of HIV, along with his fellow German-speaking boyfriend Jacob.

He said: “In October or November 2012 I was very sick. I thought it was just a cold in the beginning. I got weaker and weaker and my bones were hurting and I had to stay in bed all day.”

On how it affected his relationship, he said: “I felt betrayed and then again nobody knew who had brought it into the relationship.

“We were accusing each other and nobody was sure any more. It turned out he cheated on me with his ex-boyfriend who he was living with in a flat share in east London.

“We bonded together but at the same time it was devastating. It was a love-hate relationship.”

Daniel Cohen, defending, asked: “Did your diagnosis have any impact on your lifestyle?”

The defendant said: “It is a life-changing event. It’s something you have to come to terms with. That bonded us together but at the time time we were fighting over it. We developed a more aggressive sexual life.

“We had the feeling that now these stages of HIV were not a concern any more, we could have more sex with other men, unprotected sex as well. That was our idea.”

Varchmin told jurors the pair began inviting more men to the flat for “chill-out” sex and drugs parties and took methadrone because it “makes you horny”.

The only other drug he had tried was “G” (GHB) but only Jacob took the harder drug crystal meth and ended up losing his job as a waiter because of it.

He said: “It started with the drugs. The effect is you are very drawn to devices. You would be constantly on your phone looking for guys. You want to chat, meet, do things.

“People who take methadrone are looking for more guys on Grindr and invite them in. At peak times we had five or six. It was a bit of a revolving door.

“It was a group of gay men hanging out, listening to music. There would always be guys who would walk off into rooms and have sexual intercourse.”

Varchmin said he gave these people access to the computer the indecent images were found on.

The prosecution have claimed the defendant had searched the internet for indecent images of children using German words.

However, Varchmin said he also gave his German boyfriend a key to his flat and access to all his devices because he was “jealous” about the people he was talking to.

Officers found 45,000 images and 106 movies on the defendant’s mobile phone and computer, the vast majority of which were “adult porn”, the court has heard.

Of more than 100 indecent images, many of them were duplicates, the court heard.

Varchmin denies seven charges of possessing indecent images of children and possessing 830 milligrams of crystal meth.

The trial continues.