Detectives arrested four men yesterday when they recovered a stolen £30m Leonardo da Vinci painting in a raid on the offices of a prestigious law firm.

Officers moved in to intercept a meeting called to finalise a deal for the return of Madonna with the Yarnwinder, which was taken from the late Duke of Buccleuch's home at Drumlanrig Castle, north of Dumfries, in 2003. It was the UK's biggest art theft.

The picture, which measures 20in x 14in unframed, was present during the late morning session at the offices of HBJ Gateley Wareing in WestRegent Street, Glasgow, and was reclaimed at the culmination of an 18-month surveillance operation.

Police said four men, one from Glasgow and three from Lancashire, are expected to appear at Dumfries Sheriff Court this morning.

One partner in the legal firm, Calum Jones, was among those taken away by police. Sources said the Glasgow lawyer had been checking that a repatriation agreement would be valid in Scots law.

It is understood other parties involved in the deal were an English solicitor, an art valuer, and a loss adjuster acting for the insurers of Buccleuch Estates. The estate said last night it was unaware of the agreement.

Despite the priceless nature of the painting, it is thought that the late duke, who died last month, had already received an insurance pay-out of just over £3m, as the collection at Drumlanrig was under-insured.

Dozens of officers from Dumfries and Galloway and Strathclyde Police, the Serious and Organised Crime Agency, and the Scottish Crime and Drugs Enforcement Agency took part in the raid, which will be seen as a major coup for the agencies.

A woman who works nearby said: "At about 11.30am I noticed a lot of police activity outside. Three police cars and a police van had drawn up. There were no blue lights, no sirens. The next thing I knew two uniformed police officers were standing guard outside the entrance to the solicitors' office.

"It looked as though more than 10 plain clothes officers went into the office. A short time later, they brought men out of the office in handcuffs.

"As they were brought out in ones and twos, they were put into the cars and the cars drew away. It all seemed to happen very quickly. There was no real fuss.

"A number of plain clothes officers seemed to be involved in removing items from the building. That lasted about half-an-hour. One of the things taken away was a big paper envelope.

"The plain clothes officers came down the front stairs outside the office and just left. The uniformed officers left at the same time. It was all over in about 45 minutes. It was very eventful. You don't see things like that happening every day."

Legal sources said that the partner was working to help an English solicitor on the repatriation deal and other senior HBJ Gately Wareing staff were unaware of the project.

They were said to be "shocked" at the police raid but insisted he would be shown not to have been involved with any impropriety and had been acting only in a "lawyerly" manner.

Sources close to the investigation, which began after intelligence was received in early 2006, said Scottish links to organised crime were behind the 2003 theft and additional arrests were expected over the next few days.

One added: "The key was getting the Madonna back safe and sound. We couldn't arrest anyone until that end was achieved. Now we've got it back, the work of the past 18 months will unfold and more people will be visited."

Detective chief inspector Mickey Dalgleish, the lead officer, said: "We are extremely pleased to recover the painting. The recovery is down to extensive police inquiries and the combined efforts of several Scottish police forces, the SCDEA, and Soca. For four years, police staff have worked tirelessly on the theft and with help from the public we have been able to track down and locate the painting."

It was authenticated yesterday afternoon by Michael Clarke, director of the National Gallery of Scotland and a renaissance art expert.

The new Duke of Buccleuch said: "We express our gratitude to the police for the determined way in which they have pursued their investigation and look forward to receiving further information in due course."

The audacious theft on August 27, 2003, stunned the art world. Two men posing as tourists taking a tour of the castle overpowered a young female tour guide before snatching the painting from its wall mountings. Despite a full-scale police operation, they escaped and their getaway car was found abandoned nearby.

Yesterday, the police finally caught up with the missing Da Vinci. Eyewitnesses described the scene in West Regent Street at 11.30am.

A security guard working near the solicitors' office said that seven unmarked police cars and four marked vehicles drew up outside. He said: "A short time later, men were led in handcuffs from the solicitors' office. The last man had a coat over his head.

"A large silver-coloured box was taken from the office. Two police officers put it into an unmarked car. One officer was in the car, and was told to get another guy in there as well.

"It was all over in about three-quarters of an hour. There was no screaming, no tears, no shouting. Those taken away in handcuffs all looked very pale."

HBJ Gateley Wareing's history dates back more than two centuries. Since January 2006, it has operated as a merged firm, incorporating the Edinburgh-based firm Henderson Boyd Jackson, and Gateley Waring, headquartered in Birmingham. It has other offices in Leicester and Nottingham.

Managing partner is Malcolm McPherson, a former managing partner of Henderson Boyd Jackson and chairman of Hibernian FC from 1998 until 2002, until he resigned after disputes over the club's direction.

According to HBJ Gateley Waring's website, Calum Jones was educated at Dundee University and qualified as a lawyer in 1988. He is a partner in the company's corporate department, specialising in corporate finance and corporate insolvency.

From Kilmacolm, Renfrewshire, his interests are listed as golf, reading, wine and walking. A married man with children, his favourite sport is listed as rugby union although he supports Dundee United.

A spokesman for the company declined to comment on yesterday's events.