ALEX Salmond has told a court he had a "consensual sexual liaison" with a woman who alleges he tried to rape her.

The former first minister of Scotland began giving evidence at the High Court in Edinburgh on Tuesday.

He denies 13 allegations of offences against nine women.

Salmond earlier told jurors he believes some of the accusations against him have been "deliberate fabrications for a political purpose".

A former Scottish Government official, known as Woman H, previously told the court she felt "hunted" by Salmond moments before an alleged attempted rape in the first minister's official residence, Bute House in Edinburgh, in June 2014.

She also said she had been sexually assaulted by him in May 2014 when he allegedly kissed her face, neck and touched her legs.

Salmond said no incidents took place during those months but there had been a "sexual encounter" in the previous year following a dinner and "one thing led to another" on the complainer's "initiative".

Under questioning from his lawyer Gordon Jackson QC, he said: "There was then a consensual sexual liaison."

He added: "Neither party were naked but in a state of partial undress, in terms of buttons or whatever.

"It shouldn't have happened but both of us agreed it would be put behind us."

Salmond, who described himself to the court as a "journalist" and "retired politician", added: "It was just two old friends and things had gone too far.

"Both of us realised it wasn't a good idea and we parted good friends."

The former first minister told jurors he has never had a non-consensual relationship with a woman in his life as he was questioned about another allegation that he assaulted a woman in his bedroom at Bute House in late 2013.

He said he and a Scottish Government official, known as Woman F, had "collapsed into what I would describe as a sleepy cuddle" on a bed after they drank the Chinese spirit Maotai together.

Salmond claimed he said sorry two weeks later when the issue was raised by one of his staff, saying she had a "legitimate grievance, even if it wasn't what actually happened and not what was presented at the time".

The accused said: "I apologised. I was the first minister. She was in my bedroom. We were tipsy, it shouldn't have happened."

Asked if he had intended to rape her, Salmond said: "I have never attempted a non-consensual sexual relationship with anyone during my entire life."

Earlier, he said one of his accusers had encouraged at least five other people to exaggerate or make claims against him.

The senior Scottish Government official, known as Woman A, said he sexually assaulted her in Glasgow between June and July 2008.

But Salmond told the jury: "I would never, under any circumstances, be touching (the complainer) inappropriately.

"These are all public places. It would be insane to do anything like that. These claims are a fabrication."

He also denied running his hands down her body at a nightclub in Edinburgh in December 2010.

"What's a fabrication is that on the dance floor I proceeded to sexually assault her," he said.

"It's not just a fabrication, it's ludicrous. It makes no sense whatsoever and that's because it's not true.

"It is a fabrication, just as she has encouraged at least five other people to exaggerate or make claims against me."

Salmond said he wished he had been more "careful" with personal space and did not mean to offend.

He added: "I'm of the opinion, for a variety of reasons, that events are being reinterpreted and exaggerated out of all possible proportion."

Asked why, he said: "There were two reasons - one is that some, not all, are fabrications, deliberate fabrications for a political purpose. Some are exaggerations taken out of proportion."

Salmond agreed with his lawyer that "things that didn't happen" or "innocent things" had been "turned into sexual offences", as he was taken through the charges against him.

He said a civil servant in the Scottish Government, known as Woman B, had "misremembered" the incident where she accused him of grabbing her and trying to kiss her following a meeting in Bute House in 2010.

He said: "It was a joke, it was hijinks, it was a piece of fun. It was not meant to be anything more than that."

Salmond denied claims there was a policy that prevented him being alone with female civil servants at Bute House.

Salmond is on trial over accusations of sexual assault, including an attempted rape, spanning a period between June 2008 and November 2014.

His lawyers previously lodged special defences of consent and alibi.

Consent was given as a defence for three alleged sexual assaults and an alleged indecent assault against three women.

The trial, before judge Lady Dorrian, continues.