Mr Graham, top left, was said to be the victim of a conspiracy
A court has heard claims a private investigator accused of holding a stolen Leonardo da Vinci to ransom was the victim of a conspiracy.
The High Court in Edinburgh was told Robert Graham had been deceived by both his lawyer and an undercover policeman.
Solicitor advocate John Keenan said his client had only ever believed he was acting within the law.
Mr Graham is one of five men who deny conspiring to extort £4.25m to bring back the Madonna of the Yarnwinder.
The painting was stolen from the Duke of Buccleuch's Drumlanrig Castle in 2003.
The jury at the extortion trial has been hearing the closing speech from Mr Keenan.
He reminded them that when Mr Graham came by information about how the painting might be acquired and returned he sought legal advice from his lawyer Marshall Ronald.
Mr Ronald, in turn, went to two Scottish lawyers.
That led eventually to him negotiating reward money with a man called John Craig who he believed to be an agent of the duke but who was actually an undercover policeman.
Mr Ronald kept Mr Graham in the dark about the detail of that, said Mr Keenan and, later, had actively deceived him.
Mr Keenan said Mr Ronald and the policeman had conspired to lie to his client by telling him there was a signed contract - lodged with lawyers - which stated he was acting on behalf of the duke in getting the painting back.
"There was certainly no conspiracy to extort money by the five men sitting in the dock," said Mr Keenan.
"The only true conspiracy was between Marshall Ronald and John Craig to deceive Robert Graham."
Later, the jury was told that Mr Graham's private-eye colleague John Doyle was just as much a victim.
In his closing speech, his defence agent, solicitor advocate Maurice Smythe, said John Craig had been like a "circus ringmaster". The undercover officer had taken charge and was "pressing the buttons".
He reminded the jury that Mr Graham had been heard to offer to Mr Craig that he would take the painting straight to a police station but Mr Craig had told him not to.
"That offer was a contradiction of extortion," he said, but Mr Craig rejected it because it "interfered with his real agenda".
"He wanted not only the painting," said Mr Smythe. "He wanted bodies. He wanted arrests."
Mr Smythe said both Mr Doyle and Mr Graham "believed in their heart and soul" that they were doing an honest thing. When they took the painting to Glasgow they were "full of pride - bursting with it".
"Their intentions were entirely pure. They were giving it back to the duke. They were delighted to do so," he said.
He dismissed the Crown's suggestion that they were involved in a criminal conspiracy as "a mad idea".
On trial with Mr Graham, 57, Mr Ronald, 53, and Mr Doyle, 61, all from Lancashire, are Calum Jones, 45, of Renfrewshire, and David Boyce, 63, of Lanarkshire.
They deny conspiring to extort £4.25m between July and October 2007. The trial continues.