An agricultural company has admitted health and safety failings which resulted in an eight-year-old boy losing part of his leg.
James Kelly & Sons, which operates a beef and poultry farm at Airdrie Farm, Kirkbean, was fined £10,000.
They admitted breaching children in agriculture regulations and part of the Health and Safety at Work Act.
A court heard the boy had fallen from an all-terrain vehicle with a grass cutting machine attached.
Dumfries Sheriff Court was told that on the morning of 14 October 2015 he had been allowed to ride alongside a company employee on the ATV.
The boy fell and injured his lower right leg on the cutting machine.
He was rushed to hospital but subsequently had to have his lower leg amputated below the knee.
The Health and Safety Executive investigation found a number of failings in relation to training and safety and subsequently served an improvement notice on the company.
Speaking following the sentencing, Alistair Duncan, head of the health and safety division at the Crown Office, said: "It is illegal to allow a child under 13 years old to be carried on a machine such as the ATV in this case.
"This accident resulted in life-changing injuries that could have been avoided if the appropriate measures had been in place at the time.
"A child in a farm environment will often feel themselves to be at home, and be considered so by their family, when in fact for the purposes of health and safety legislation they are in a work environment."
He said the case highlighted the dangers involved in using such vehicles, particularly where children are concerned.
"No other industry allows children into the workplace where they may be at risk of serious injury or, in the worst case scenario, a fatality," he said.
"It is crucial that they are protected from the high risk activities that make up agricultural work."
Health and Safety Executive Inspector Kim Munro said there were "no winners" in the case.
"We're calling on farmers to take responsibility and own the process of identifying, managing and preventing risk in their workplace," she said.
"We've spent recent weeks highlighting this issue, with more inspectors visiting farms across Great Britain."