Tommy MacFarlane, 69, was unable to get out of the way of a cow – described as a “wild beast” – which jumped over five-foot-high hurdle gates being used to pen the animals.
The 600kg heifer caught its hooves between the bars and brought two heavy metal gates crashing down onto Mr MacFarlane’s chest.
As the first beast escaped into the farmyard, around seven other cows followed it, also running over Mr MacFarlane as he lay on the ground.
The farmer was rushed to Edinburgh Royal Infirmary in June 2016 where X-rays showed he had rib fractures and a significant laceration on his head.
Three days later he was transferred to a different ward and treated for pneumonia, one of the complications found in the post mortem.
The court heard medical evidence that Mr MacFarlane had also suffered a stroke, and had lung disease, and pre-existing heart problems which could have contributed to his death.
He finally succumbed to his injuries in hospital in August of that year, with the formal cause of death put as “complications of head and chest trauma following a farming accident”.
Giving evidence to the inquiry at Livingston Sheriff Court, eyewitness Andrea Taylor, 28, described the tragedy as a “one-off” accident.
Ms Taylor, whose family run an arable farm close to Mr MacFarlane’s Cuthill Farm, near West Calder, West Lothian, said she had never seen a cow leap so high either before or since the accident.
She said Mr MacFarlane –who she described as being “like family” to her – had phoned on the morning of the accident to ask her to help him load cattle on to a truck heading for a slaughterhouse.
After the accident, she said she took charge of Mr MacFarlane’s sheep and visited him regularly in hospital to tell him how the flock was doing.
She said Mr MacFarlane’s condition deteriorated after a couple of weeks and he was moved into intensive care.
She was at his side when he passed away and also attended his funeral.
Inquiry judge, Sheriff Douglas Kinloch, will publish his findings in due course.