Three Hearts and Three Lions (1961), by Poul Anderson, sees a Danish resistance fighter during World War II transported to a world of medieval fantasy after being wounded in combat. There, Holger becomes embroiled in a conflict between the cosmic forces of Law and Chaos. He makes some friends, goes on a quest and eventually learns he’s a King Arthur-like figure, destined to turn the tide, in this reality or any other, whenever Denmark is threatened.

The man out of time premise is preposterous and mostly used as an excuse for Holger to ponder the scientific underpinnings of the magic he encounters (when the sun turns a giant to stone, it creates a deadly radioactive isotope!). The biggest flaw of the book, though, is the fact that in matters of romance, Holger is an entitled creep and there is an undercurrent of horniness and sexual frustration throughout. Meh.
That said, it is clearly an important building block for Dungeons & Dragons. The original alignment system springs directly from the novel, with humanity embodying Law and the supernatural races of Faerie championing Chaos. (Coupled with Holger’s traveling through alternate realities as a mythic warrior, the book is also an obvious inspiration for Michael Moorcock’s Eternal Champion stories). The structure of the quest, the way secondary characters pop in and out of the narrative and the interplay between the companions feels like it informs the basic tenants of how a D&D campaign flows (though no dungeons here – the action is primarily wilderness and towns).
Anderson also provides the blueprints for a couple classic D&D creatures. One of Holger’s traveling companions is a Swanmay and the dwarf’s Scottish brogue seems like another, albeit small, contribution. The biggest, though, is Anderson’s troll, which Gygax lifted directly for D&D. The troll encounter is easily the best scene in the book and holy crap does Anderson make it terrifying. I wish Patrick “Sad Wings of Destiny” Woodroffe had chosen it for the cover.