Former leader of the Conservative Party Colin Craig believes the man suing him for defamation had a strategy aimed at removing him from the leadership of the Party.
Mr Craig made the claim while giving evidence in his defence at the High Court in Auckland.
He is being sued by Jordan Williams, the chief executive of the Taxpayers' Union, over allegations made in a widely distributed leaflet last year.
Mr Craig's defence was opened by his lawyer Stephen Mills QC, who told the the court the case rested on his client's right to respond to an attack on his reputation.
"If someone punches you can punch back, within reason. And that's the type of qualified privilege that Mr Craig is raising as a defence here. That he was responding to an attack upon his reputation by the things the plaintiff did," he said.
After Mr Mills finished his brief statement, Colin Craig took to the stand, watched by Jordan Williams and Cameron Slater, whose blog, Whale Oil, published allegations about Mr Craig's relationship with his press secretary, Rachel MacGregor.
Mr Craig said it was a bolt out of the blue when Ms MacGregor laid a sexual harassment complaint against him in January last year.
After mediation in May, he believed that they had reached a number of resolutions about Ms MacGregor's remuneration and a private loan.
He said, "I also reached a separate confidential agreement on her sexual harassment claim in which we agreed that on some occasions our behaviour had been inappropriate and in which she agreed to withdraw the claim."
Mr Craig hoped that would be an end to the matter - but later that month, senior Conservative Party figure, Christine Rankin contacted him regarding rumours of sexually explicit texts and payments to Ms MacGregor.
Mr Craig could not fully answer the questions because he was bound by a confidentiality agreement with Ms MacGregor.
"Of particular concern to Christine was the text that I supposedly sent on the day of or the day before Rachel's resignation.
"It said, I wished I was lying between your naked legs. I told Christine that was mischief-making nonsense. I had never sent this or any other sexually explicit text."
But the Conservative Party board wanted more information.
Throughout early June last year, Mr Craig came under increasing pressure from his board, who had been told the allegations against him were about to go public.
When various revelations about Mr Craig were made on the Whale Oil Blog, he described the media onslaught as unrelenting.
"It's dynamic material. If you've got sex, poems and money - six figure sums - all covered up in secret and you put that into a blog, every person in the media is going to want a piece of that story."
"And that's exactly what happened," he said.
Mr Craig spent much of his time on the stand listing the media coverage that he said left his reputation in ruins.
He told the court he suspected Jordan Williams was behind the leak of information, and he had been proved right.
In the coming days, Mr Craig's wife Helen will be called to give evidence, as well as Bob McCoskrie from Family First, the Sensible Sentencing Trust's Garth McVicar, left-wing blogger Martin "Bomber" Bradbury and investigative journalist, Nicky Hager.
Mr Craig is due to continue giving his evidence at the High Court in Auckland this morning.