whiteout: More farmers are likely to assist in the event of a harsh winter under the new deal. Picture: PA
Specialist equipment from some of Scotland's 27,000 farms will be used to clear rural roads as well as some urban routes, mostly in housing estates.
A number of councils already have long-standing arrangements to pay farmers to supplement the work of roads departments during winter.
However, hundreds of farmers took on a far greater role during the winters of 2009/10 and 2010/11, in which there were prolonged periods of sub-zero temperatures and snowfall of more than 7ft.
The deal on resilience measures struck between the National Farmers Union Scotland (NFUS), Government agency Transport Scotland and the Society of Chief Officers of Transportation in Scotland (Scots), which represents council transport chiefs, aims to put this relationship on a more formal footing.
Prior to the agreement, some farmers had complained a lack of clear guidelines and disparity in the rates of pay made it uneconomic to continue providing such a service.
Transport Minister Keith Brown said: "This code of practice encourages a consistent approach to engaging farmers in winter service.
"It highlights best practice, as well as important compliance and risk issues both parties need to be aware of and suggested minimum standards."
NFU Scotland's legal and technical committee chairman, John Smith, said: "Farmers and agricultural contractors have a vital role in keeping Scotland's rural communities moving when winter hits.
"In the harshest of weather, farmers have proven themselves to be able and willing to play their part in assisting local authorities.
"Keeping all roads clear in winter not only benefits the food and farming sectors but ensures all communities, no matter how remote or vulnerable, have access to the full range of required services.
"Because the payment rates varied so widely, a lot of farmers were finding it wasn't financially worth it, or they were making a loss."
Ewan Williams, chairman of Scots, said: "This code will help councils engage with farmers across Scotland to keep our rural roads clear."
The code of conduct should ensure farmers are still eligible for fuel duty rebates on "red diesel", which carries a lower tax levy than regular fuel, when operating snow ploughs or gritters, making it more likely they participate in winter resilience plans.
It recommends arrangements are put in place, including local agreements on payments, ahead of winter.
Transport Scotland last week announced revised winter resilience measures, including the use of two Finnish ice breakers that will be used to clear heavily packed ice from key routes and special de-icer liquids that can function at temperatures lower than -10°C.
Contextual targeting label: