Media playback is unsupported on your device Media caption Earthworm Dave is trending on social media after he was killed and put in a jar

An earthworm named Dave has wriggled into the record books as the largest found in the UK - measuring a whopping 40cm (15.7in).

Experts at the Natural History Museum bestowed the accolade upon the annelid after it ventured above ground in a vegetable plot in Widnes, Cheshire.

The Lumbricus terrestris was studied at the museum before being killed in what staff called "the sad bit of science".

It is now in a jar and will be "kind of immortal", the museum said.

Image copyright Harry Taylor/NHM London Image caption Natural History Museum scientist Emma Sherlock said she was "bowled over" by Dave's size

However, not everyone was delighted with Dave's scientific sacrifice, and social media sites have been flooded with tributes.

Thousands of people have posted comments on Twitter using the hashtags #justicefordave and #justicefordavetheworm.

Within hours, a spoof @PoorDaveTheWorm Twitter account had also been created.

Media playback is unsupported on your device Media caption The euthanised death of the largest earthworm found in the UK, named Dave, caused anger.

Image copyright Twitter/Mel Dobson

Image copyright Twitter/Tiffany Oconnell

The 26g (1oz) worm was found by Paul Rees. It was given the moniker Dave by Mr Rees's stepson George.

Natural History Museum scientist Emma Sherlock said: "I was bowled over by the size of this worm when I opened the plastic box they sent it in.

"Not only was it really long, it was almost twice as heavy as any other wild earthworm ever seen, weighing the same as a small chocolate bar.

"Dave is now preserved in the museum collections, and will now be useful to science."

Image copyright NHM London

She added: "Although his name on the jar is Lumbricus terrestris, little George did request that his real name, Dave, be preserved forever too - so on the label it clearly states 'known as Dave' and that will be reflected in the museum database forever too."

Ms Sherlock said the previous longest UK worm, unearthed in 2015, grew to 39.6cm (15.6 inches) on the Scottish island of Rum.

She said: "With worms this size Paul must have an incredibly fertile and well-drained vegetable plot with decaying matter quickly recycled back into the soil."

Factfile: Earthworms

Image copyright Thinkstock

Scientific name is Lumbricus terrestris

Lifespan of up to six years

Vital to soil health, as their tunnels aerate the ground

Capable of digging as deep as 6ft 6in (nearly 2m)

Eaten by animals including birds, rats and toads

Contrary to playground legend, a worm sliced in two will not grow into two worms

Source: National Geographic

Among the tributes to Dave left on Twitter, Jessy Harvey wrote: "Still saddened by the senseless euthanasia of Dave the earthworm."

Jungle Janet posted: "RIP Dave. You were unique and before your time and it would have been amazing to see a blackbird wrestle with you."

Kevin wrote: "He might have got bigger if you hadn't murdered him!!!"

And Andre Walker said: "It does strike me as odd the Natural History Museum measured the UK's longest ever worm then killed it!"

Image copyright Twitter/@Melamaphine

Image copyright Twitter/Des Arthur

Responding to the tweets, a Natural History Museum spokeswoman said: "This may seem sad but natural history collections have always contained dead individuals of plants, microbes, fungi and animals as evidence for study and reference."

She added that "only very few" earthworms were kept as a record and they were "euthanised humanely to professional standards".

Dave would "have a legacy that lasts beyond all of our lifetimes," she said.

"These specimens help scientists better understand and protect the natural world, from studying an individual species to looking at environmental impacts of climate change, pesticides or human health".