Tommy Sheridan's successor as leader of the Scottish Socialist Party has told a jury the MSP confessed at a party meeting to visiting a swingers club.
Colin Fox was reprimanded by the judge for a quip about his holiday
Colin Fox, who returned from holiday in Portugal to give evidence at the Court of Session in Edinburgh, described the admission as a bombshell.
An emergency meeting was called after the News of the World printed details about the sex life of an unnamed MSP.
Mr Sheridan has launched a £200,000 defamation claim against the tabloid.
Socialist MSP Mr Fox, 47, told the court: "Mr Sheridan took issue with a great deal in the story.
"He did admit he had visited a swingers club."
On what should happen next, Mr Fox said: "Many people thought the best way to confront these allegations was in the court of public opinion rather than the law courts."
The witness was then reprimanded by the judge, Lord Turnbull, after he made a remark about completing his evidence quickly in order to resume his holiday.
Mr Fox told the court that if Mr Sheridan wanted to fight what he called "smears" he would have backed him.
Michael Jones QC, counsel for the News of the World, said: "Would you have felt quite happy with your own conscience if Mr Sheridan had gone public and denied he had visited the club?"
Mr Fox said: "It is a very difficult question to answer yes or no but I suppose if you are asking me about my conscience I would say yes."
He also told the court he wanted Mr Sheridan to "come clean", accept it was an indiscretion and move on.
Mr Sheridan put it to the witness that he had been mistaken in his recollection of the 9 November meeting or he had fabricated what had happened.
Mr Fox said: "I am not mistaken.
"I am absolutely categorically clear on what took place at the meeting."
A political activist who wrote minutes of the emergency meeting said to contain allegations about Mr Sheridan's sex life then told the court she was "incandescent with rage" that her word was questioned.
Tommy Sheridan is representing himself in court
The document, read to the jury, claims Mr Sheridan admitted to comrades he had twice visited Cupids swingers club in Manchester but wished to continue denying it in public because, he said, there was no proof.
Mr Sheridan has maintained the minute is not a true and accurate record of the meeting and that, in fact, he denied the sex club allegation.
The court heard from Barbara Scott, 36, who said she took notes at the executive meeting on 9 November, 2004 and wrote them up afterwards.
She also agreed that she had joined a faction in the SSP which opposes Mr Sheridan's decision to sue the Sunday tabloid.
Mr Sheridan said: "I have to put it to you as part of the concoction of what I believe to be a dodgy minute, you and other members of this faction have colluded to undermine me politically."
Ms Scott told him: "No I absolutely and categorically refute that."
She said she had been taking minutes for three years and no-one had questioned either her integrity or her ability to remember things.
Ms Scott added: "I am absolutely incandescent with rage that you should say the minutes are concocted because you know they are the truth."
Later, MSPs Carolyn Leckie and Rosie Kane both said they had heard Mr Sheridan admit he had been at the club.
Ms Leckie said it "hadn't been about judging behaviour but about the most popular, most famous convener with a huge reputation for principle, honesty and integrity being shown to be a hypocrite and a liar".
Mr Sheridan put it to Ms Leckie that she had come to court in pursuit of a political faction fight and had never heard him making that admission.
She replied: "That's a fantasy of yours, Tommy. You just can't take responsibility for your actions."
The case continues.