Tommy Sheridan had three-in-a-bed sex with a married member of the Scottish Socialist Party (SSP) and his brother-in-law, a court has heard.
Katrine Trolle, 36, also told the High Court in Glasgow that she had sex with Mr Sheridan at his family home while his wife attended a Christmas party.
Mr Sheridan and his wife Gail, both 46, are on trial accused of perjury.
They deny lying during his successful defamation case against the News of the World in 2006.
Mr Sheridan, the former leader of the Scottish Socialist Party (SSP), won £200,000 in damages after the newspaper printed allegations about his private life, claiming he was an adulterer who had visited a swingers club.
After a police investigation, Mr and Mrs Sheridan were charged with perjury.
The indictment against Mr Sheridan contains the charge that he had lied about having sexual relations with Ms Trolle during his defamation case.
Ms Trolle, 36, who is originally from Denmark but moved to Scotland in 1996, told the trial she had slept with Mr Sheridan on numerous occasions.
She said the former Glasgow MSP had initially been "quite interested" in Danish "liberal values on pornography and sex".
Ms Trolle told the court they first had sex during the SSP's campaign for the Glasgow Anniesland by-election.
She said: "While we were leafleting we had been flirting quite a bit and he asked me if I would come and see him.
"Obviously, I agreed and he came to pick me up a little bit away from where I was staying.
"I was staying with my then mother-in-law and it would have looked suspicious.
"He picked me up and we went to his house. I think I had a glass of wine and without much further ado we went up to the bedroom and had sex."
Ms Trolle told the court that shortly afterwards, Gail Sheridan had called her husband and asked him to pick her up from a Christmas party.
She said: "We quickly got dressed and he drove me home so he could pick up Gail."
Ms Trolle said she next encountered Mr Sheridan "many months" later, when he called her and asked her to come to Glasgow.
She said she got the bus from Aberdeen and he met her at the bus station, before taking her to his brother-in-law Andrew McFarlane's house in the Cardonald area of Glasgow.
She said: "He hadn't actually said we were going to his brother-in-law's house. I was thinking I was going to see him.
"As we drove over to his brother-in-law's house, it slowly dawned on me that all three of us were going to have sexual intercourse.
"We arrived and Andy opened a bottle of wine so he and I could have a glass of wine. Tommy went upstairs and not long after I went up there as well.
"I was getting undressed, or Tommy was helping me to get undressed, when Andy appeared. We spent most of the night having sexual intercourse."
Ms Trolle went on to tell the court how she and Mr Sheridan had sex on several other occasions - including at Glasgow City Chambers and at Cupid's swingers club in Manchester.
They also met up for sex at Ms Trolle's flat in Aberdeen while her husband was out at university, and later when she moved to Dundee in 2002.
She said they had sex in Sheridan's City Chambers office after a St Andrew's Day march on 24 November, 2001.
Ms Trolle told the court that Mr Sheridan had mentioned going to Cupid's club in Manchester "several times" before they decided to go.
She said that initially she had not wanted to go, but Mr Sheridan had talked her into it.
She said she travelled to Glasgow from Aberdeen and was taken by Mr Sheridan to his friend Gary Clark's flat.
They were joined there by Anvar Khan and Andrew McFarlane, and Mr Sheridan drove them all to Manchester.
Ms Trolle said: "The club looked nothing like it had been described. I remember that I thought to myself that I was an absolute idiot.
"Tommy had described it as being a really lovely, fancy, nice place, and it wasn't.
"There was minging decor - old carpets, dingy lighting. It really wasn't anything that Tommy had described.
"We went to one of the little side rooms and had sex - all of us."
She also told how she was left "tongue tied" with embarrassment when Mr Sheridan was recognised by another visitor who mistook her for his wife Gail.
She said: "There was a guy who recognised Tommy Sheridan. He looked at me and he said: 'You must be Gail'.
"I didn't know what to do when he said that. I got tongue tied. I looked away and pretended I hadn't heard him."
Finally, the group met two other couples at the club and left with them to go back to a flat in Manchester and "we all had sex with various partners", she said.
After a night that went on "for too long", Ms Trolle said Mr Sheridan drove the group back to Scotland.
She said she went on to sleep with Mr Sheridan on two further occasions in Dundee in 2004 before the News of the World article was published in November that year.
She was later cited as a witness in the 2006 defamation action.
The witness said she initially wanted to "ignore" it, as it was sent to her married name and she had since divorced.
But she contacted Mr Sheridan's lawyer and told him what she would tell the court.
Ms Trolle said: "I plucked up the courage. He was very friendly. I interrupted him and said: 'If you call me, this is what I am going to say.' I explained what had happened. He became very quiet."
She said she had been "terrified and embarrassed" when she gave evidence in Edinburgh four years ago, but insisted she had told the truth both then and now.
The indictment against Gail Sheridan states that she lied about seeing Katrine Trolle at the SSP conference in Perth in 2005.
She swore under oath that she had seen and spoken to Ms Trolle at the conference.
But Ms Trolle told the court she was "certain" she had not been there, saying she had been babysitting for a friend at the time.
Ms Trolle was cross-examined by Paul McBride, Mrs Sheridan's QC, who accused her of "enjoying the attention".
Mr McBride said: "Gail Sheridan has the indignity of sitting here at the High Court and hearing you had sex with her husband, in her own home on her own bed. All of this without her knowledge. You will be aware of the indignity that will cause?"
Miss Trolle said: "Yes."
She also admitted being involved in more than 10 "extra-marital activities" during her four-year marriage.
The court was then adjourned briefly after a request from Mr Sheridan when it appeared his wife had become upset.
It is alleged that Mr Sheridan made false statements as a witness in his defamation action against the News of the World on 21 July 2006.
He also denies another charge of attempting to persuade a witness to commit perjury shortly before the 23-day legal action got under way.
Mrs Sheridan denies making false statements on 31 July 2006, after being sworn in as a witness in the civil jury trial at the Court of Session in Edinburgh.
The trial is due to last between two and three months and is expected to become the longest perjury case in Scottish legal history.