A scientist has shed new light on the origins of Charles Darwin's "abominable mystery".
The famous naturalist was haunted by the question of how the first flowering plants evolved.
Darwin feared this inexplicable puzzle would undermine his theories of evolution, says Prof Richard Buggs.
Forgotten historical documents show a rival scientist was arguing for divine intervention in the rise of the flowering plants.
This greatly vexed Darwin in his final months, says the evolutionary biologist at Queen Mary, University of London.
"The mystery seems to have been made particularly abominable to him by its highly publicised use by the keeper of botany at the British Museum to argue for divine intervention in the history of life," he says.
What is the abominable mystery?
Darwin coined the phrase, abominable mystery, in 1879. In a letter to his closest friend, botanist and explorer Dr Joseph Hooker, he wrote: "The rapid development as far as we can judge of all the higher plants within recent geological times is an abominable mystery."
The mystery centres on the rise of the flowering plants, or angiosperms, the family of plants that produce flowers and bear their seeds in fruits.
They make up the vast majority of all known living plants, from oaks to wildflowers and water lilies.
Flowering plants appeared on Earth relatively recently on a geological timescale, then swiftly diversified in an explosion of colour, shape and form.
"In the fossil record they appear very suddenly in the Cretaceous, dated at about 100 million years ago, and there's nothing that looks like an angiosperm before them and then they suddenly appear and in considerable diversity," says Prof Buggs.
Questions raised by the sudden appearance of flowering plants are at the heart of Darwin's abominable mystery, he explains.
"Why isn't there a gradual evolution of the angiosperms? Why can't we see intermediate forms between the gymnosperms - things like conifers - and the flowering plants? And why, when they appear, are they already so diverse?"
Why was Darwin puzzled?
Darwin was deeply bothered by how flowering plants conquered the world seemingly in the blink of an eye, while other large groups, such as the mammals, evolved gradually.
The advent of flowering plants suggested evolution could be both rapid and abrupt, in direct contradiction to an essential element of natural selection, natura non facit saltum - nature makes no leap.
Darwin toyed with the idea that flowering plants might have evolved on an as yet undiscovered island or continent.
In August 1881, only months before his death, he wrote to Hooker: "Nothing is more extraordinary in the history of the Vegetable Kingdom, as it seems to me, than the apparently very sudden or abrupt development of the higher plants. I have sometimes speculated whether there did not exist somewhere during long ages an extremely isolated continent perhaps near the South Pole."
What's the new thinking?
In the library at the Royal Botanic Gardens, Kew, Prof Buggs came across a re-print of a lecture from 1876 by the Scottish botanist William Carruthers that gives new context to Darwin's thinking.
William Carruthers rose to become keeper of botany at the British Museum, and "a towering figure at the time in paleobotany".
In a lecture to the Geologists Association in the library of University College London, Carruthers highlighted the problems that Darwin had with the fossil record, focussing on the sudden appearance of flowering plants.
His comments were reported in The Times and the scientific press, sparking a public debate.
"Carruthers was using the abominable mystery to launch an attack on evolution itself," says Prof Buggs. "He thought that God had created the angiosperms in the Cretaceous; they hadn't evolved.
"To Darwin and his friends, this was anathema, basically, because [Carruthers] was trying to bring supernatural explanations into the fossil record."
But Darwin had a problem. The points Carruthers was making about the fossil record were actually very difficult to explain in terms of evolution, says Prof Buggs.
He thinks this is what prompted Darwin to coin the phrase "an abominable mystery" and makes his case in a scientific paper, published in the American Journal of Botany.
The mystery was to Darwin what Fermat's Last Theorem was to the 17th Century mathematician Pierre de Fermat, he adds.
"It gives an insight into what was going on in Darwin's mind in the last few years of his life and it gives it an extra romance, almost, a bit like Fermat's Last Theorem - Darwin's last mystery, this problem preying on his mind in his final months."
And is the mystery solved?
In short, no. "One hundred and forty years later, the mystery's still unsolved," says Prof Buggs. "Of course, we've made lots of progress in our understanding of evolution and in our knowledge of the fossil record, but this mystery is still there."
Follow Helen on Twitter.