A Scottish aristocrat has revealed to a court how he became "an actor" in a police undercover operation to secure the return of a stolen £50 million Leonardo da Vinci masterpiece.

Richard Scott, the 10th Duke of Buccleuch, said he co-operated with officers in the sting following the theft of da Vinci's Madonna of the Yarnwinder painting from his family's seat in Britain's biggest art theft.

During a £4.25 million damages action brought by a former solicitor at the Court of Session in Edinburgh, the duke said: "I was an actor in a process which they were devising and creating."

Officers mounted the operation in a bid to secure the return of the Madonna painting which was stolen from Drumlanrig Castle, near Thornhill, in Dumfriesshire, on August 27 in 2003.

The Da Vinci was recovered in a police raid in October 2007 on the offices of a law firm in Glasgow.

Former lawyer Marshall Ronald has now raised an action against the aristocrat after he was cleared with four other men at the High Court in Edinburgh in 2010.

They had been accused of conspiring to extort money from the previous Duke of Buccleuch, who died aged 83 a month before the painting was found, for the masterpiece's return.

The painting was recovered in 2007 after Mr Ronald, of Upholland, Lancashire, sent a message to an undercover officer stating: "The Lady is coming home."

Mr Ronald claims in the civil action that the duke provided a letter of authority confirming that the officer, known as John Craig, acted as his agent in the recovery of the painting and was authorised to conduct negotiations.

His lawyers claim there was an agreement for £4.25m to paid to him for his role in securing the return of the masterpiece. He said this was made by Craig acting on behalf of the duke.

The duke maintains in the action that Craig had no actual authority to enter any agreement or negotiate on his behalf. It is also argued that the agreement Mr Ronald relies on is tainted by illegality and/ or is contrary to public policy.

It is said the letter of authority was requested by the police as part of their undercover operation and was designed to support John Craig's undercover persona.

His counsel Andrew Young QC asked the duke if police in the period up to the recovery of the painting had ever advised him that an individual called Marshall Ronald had come on the scene. He replied: "No."

He said he was elsewhere on the estate when the painting was stolen from the castle. His father, who was then duke of Buccleuch was "shocked and saddened" by its theft. His father died in 2007.

He told the court: "I think the police told me and my father what we needed to do in order to help them with their enquiries, but no more."

He said he had first become aware of an undercover operation mounted by the police in 2006.

He said he was informed that a man by the name of Brown had convinced the police that he had had sight of the painting and possibly had access to it.

He said he was asked by an officer to have a phone conversation with him which he did. "I knew I had to act out a role," he said.

The court also heard that he was also asked to sign a "To whom it may concern" document which was drafted by police during the sting operation.

The duke said that he had been asked to play a part in supporting the undercover officer in pursuing the investigation.

Mr Ronald had contacted a loss adjustor in August 2007 and the undercover officer, John Craig, called him.

Mr Ronald told the court: "I believe I had a contract with John Craig and it had agreed the figure."

The judge, Lord Brailsford, reserved his decision in the case.