A large fire tore through farm sheds containing 2000 litres of diesel.

At the height of the blaze in the Borders, more than 40 firefighters battled to contain the flames at West Mains Farm in Ancrum, near Jedburgh.

The Scottish Fire and Rescue Service arrived to find an intense fire involving machinery and hay bails at 8.30pm on Wednesday.

It said there was concern over the risk of the flames spreading to hazardous materials inside the farm sheds.

Crews worked through the night using high pressure jets to douse the flames as they ripped through large buildings at the site near Ancrum.

A spokeswoman for the service said the potentially dangerous substances were kept stable and there was no explosion during the incident.

She added: "Two large sheds were on fire and initial reports were that there was machinery and a large amount of hay bales involved.

"Between five and six tonnes of fertiliser was thought to be involved. It turned out to be a hazardous materials incident.

"2000 litres of diesel were also involved and acetynene cylinders. They were isolated and cooled."

While working to bring the flames under control firefighters also used high pressure jets to cool the diesel stores and acetylene cylinders, with a thermal imaging camera used to monitor the items' temperature.

A scientific adviser provided specialist guidance regarding the effect of heat on the fertiliser and firefighters requested engineers isolate power to nearby high voltage cables.

Crews were still at the scene on Thursday morning, dampening down remaining hot spots.

There are no reports of casualties from the incident.

Specialist officers from the SFRS Fire Investigation Unit will attend the scene to establish the circumstances surrounding the incident.