A stone mason who said he was exposed to dust while working at Elgin Cathedral has accepted £3.5m.
Gordon Walters was later diagnosed with life-changing lung conditions.
Thompsons Solicitors said he worked on the renovation and maintenance of the cathedral in the Moray town in the 1980s.
The Scottish government confirmed ministers had agreed to settle the case, which predated the public body which now operates the cathedral.
Historic Environment Scotland – formerly Historic Scotland – is now responsible for Elgin Cathedral.
Thompsons said it was believed to be among the largest settlements for a worker diagnosed with silicosis and systemic lupus erythematosus (SLE).
The firm said Mr Walters had been exposed to “significant” amounts of stone dust”.
He gave up his career in the mid 1990s after being diagnosed with the conditions.
Mr Walters then approached his trade union the PCS and the case was pursued.
He said he been through “absolute hell” with the conditions he developed.
“It’s ravaged my body and means I have to be supported and cared for in almost every aspect of my daily life,” he said, adding that the settlement would make it possible for all the proper care he needed to be put in place.
His lawyer Claire Campbell, a partner at Thompsons who specialises in cases involving industrial lung disease, said: “What this disease has done to Mr Walters is truly appalling.
“Silicosis and SLE are extremely cruel conditions but can be prevented.”
Mark Serwotka, general secretary of the PCS union, added: “We’re pleased to have helped secured this settlement for Gordon. We will continue to fight for our members’ well-being whatever the issue.”
The Scottish government said in a statement: “Scottish ministers have recently agreed to the settlement of this case from the 1980s.
“The circumstances of the case predate devolution and it was also before Historic Scotland was established as an organisation.”
The statement added: “The Scottish government is not funding the settlement from the funding for Historic Scotland’s successor body, Historic Environment Scotland.”
In 2015, Historic Scotland merged with the Royal Commission on the Ancient and Historical Monuments of Scotland (RCAHMS) to form Historic Environment Scotland.