The dragon soars overhead, its underside armoured with gems from its hoard. The bowman has one arrow left. Then a bird flutters to his ear and whispers the monster’s sole vulnerability – a bare patch at its breast. The last arrow strikes home. Exit Smaug the Magnificent.

It’s a marvellous moment, thrillingly told in The Hobbit (though mashed out of recognition in the last of Peter Jackson’s Middle-earth films, released this week). But Tolkien did not conjure the scene from thin air. The peculiar manner of Smaug’s death comes via a surprising source.

Smaug is made in the image of medieval Fafnir, the archetypal hoard-dragon of the Icelandic Volsunga saga, and it’s been supposed that his death owes something to the way Sigurd digs a pit to stab Fafnir in the vitals. But I felt a sudden, prickly recognition when reading – of all things – Longfellow’s 1855 poem The Song of Hiawatha.

Hiawatha faces Megissogwon, manito (spirit) of wealth, who is impervious in his shirt of wampum, the hard shell beads once used as currency. After a day-long battle, Hiawatha has only three arrows left. Victory appears impossible – until

Suddenly from the boughs above him

Sang the Mama, the woodpecker:

‘Aim your arrows, Hiawatha,

At the head of Megissogwon,

Strike the tuft of hair upon it,

At their roots the long black tresses;

There alone can he be wounded!’

And so, thanks to a bird’s revelation of his fatal vulnerability, another monstrous symbol of material wealth is brought down by a bowman almost at the end of his arrows.

I stumbled on Megissogwon’s death while researching an article for the journal Tolkien Studies, because another echo had directed me to Longfellow: the name Wanōna in the 1914 Story of Kullervo. This earliest known Tolkien tale, important as a prelude to Middle-earth, retells part of the Finnish epic Kalevala, but Tolkien peppered it with non-Finnish names. Some are entirely made up – the first glimmerings of what in 1915 became “Elvish” – but Wanōna sounds suspiciously like Wenonah, the name of Hiawatha’s mother.

With some chutzpah, just as the 22-year-old Tolkien was borrowing the name Wenonah, he was telling a student society that much of Hiawatha was “pirated” from the Kalevala. Still, he conceded Longfellow’s names were “often too good to be inventions”. Parallels between Wenonah and Wanōna suggest the borrowing wasn’t capricious: each woman is wayward, and dies in anguish after being seduced among the flowers by the wrong suitor. Wenonah’s seducer is the dastardly West Wind; Wanōna’s is her own unwitting brother Kullervo.

Hiawatha is a much better poem than it’s painted by those who know only its dum-ti dum-ti rhythm or see it as cultural plunder of Native America. In Tolkien’s day it was still immensely popular, and he had encountered it at least as early as 1912 at an Oxford undergraduate performance of The Death of Minnehaha – Longfellow’s words to the music of Samuel Coleridge-Taylor. Succumbing to sickness, Hiawatha’s wife Minnehaha’s spirit is summoned back to the waterfall after which she was named, Laughing Water. This, too, has its echo in Tolkien, in the Middle-earth story of Túrin and Nienor which he developed from The Story of Kullervo. In The Children of Húrin their sister Lalaith, who dies young of a pestilential fever, is named after the brook beside their home: Nen Lalaith – Elvish for “water of laughter”.

Other Longfellow echoes are identifiable in Middle-earth. Yet Tolkien famously dismissed literary source-hunting, comparing it to the desire to see the bones that went into the soup: identifying an earlier inventor does not uncover the secret of invention, he said. This is only partly true. The spark of invention often leaps between pre-existing points. Source-hunting can lend insight into the nature of originality, the shifting interplay between themes and memes, the permeability of cultural barriers.

Tolkien professed a childhood interest in Native American stories, with their “bows and arrows … and strange languages, and glimpses of an archaic mode of life, and, above all, forests”. The Oxford professor also recognised a superficial kinship with Longfellow. Asked whether his own academic work would be remembered, he replied: “People remember Longfellow wrote Hiawatha, and quite forget he was a Professor of Modern Languages.” But the kinship goes deep. Drawing on compendia of indigenous narratives at a time when the culture was being erased, Longfellow called Hiawatha an “Indian Edda” – a reference to the medieval anthologies that preserved the vestiges of Norse myth after Christianisation. Tolkien’s “lost tales” of Middle-earth began as an attempt to imagine northern European mythology as it might have stood before its near-demolition by Latinate culture.

Specific echoes of Megissogwon, Wenonah and Minnehaha resonate with the themes of purblind avarice, naive vulnerability and arbitrary fate seen in Smaug, Wanōna and Lalaith. They also throw into relief Tolkien’s growing craftsmanship: aside from his apprentice Story of Kullervo (listed for commercial publication next year), his narratives have a depth, detail and texture absent from Longfellow’s.

Where Longfellow’s woodpecker appears as a deus ex machina, Tolkien brings a wealth of colour, background detail and depth to make the sudden upturn in The Hobbit unexpected but explicable. The thrush is introduced long before in the prophetic moon-runes (“Stand by the grey stone when the thrush knocks …”) as the key to entering the dragon’s lair. Bard’s grasp of thrush language is inherited from forebears who conversed with the birds regularly. And the secret of Smaug’s weak spot has been extracted from the dragon by Bilbo Baggins.

Now we know the source for the death of Smaug, can we shoot Tolkien down as a plagiarist? Rather, I think, we should recognise him as an author with sympathies beyond the European, who engaged both with contemporary literature and with live narrative traditions on the point of extinction – and who could turn bare bones into the most wonderful soup.

• John Garth is the author of Tolkien and the Great War (HarperCollins) and Tolkien at Exeter College.