Daniel Kehlmann’s “Tyll” begins with a bravura opening chapter reminiscent of Shirley Jackson’s short story “The Lottery.” The setting is a small village in Central Europe, early in the 17th century. One morning a covered wagon arrives in town carrying a legendary jester, Tyll Ulenspiegel, and his troupe of performers. They put on a play; they dance and sing; and then Tyll walks a high tightrope. The show captivates the townsfolk, transporting them from their dreary provincial lives. “We understood what life could be like for someone who really did whatever he wanted, who believed in nothing and obeyed no one; we understood what it would be like to be such a person, and we understood that we would never be such people.” They throw coins at the jester, but he repays them by instigating a brawl among the spectators. While they fight, Tyll and his troupe slip away with the money.

The brawl foreshadows the much larger conflict at the heart of “Tyll”: the Thirty Years’ War, fought among European powers from 1618 to 1648. While the title and the opening chapter suggest that the jester will be this novel’s central character, Tyll winds up a Zelig-like figure who appears in every chapter (sometimes as a cameo) sowing chaos and telling truths no one wants to hear. Each chapter functions as a self-contained short story or novella with recurring themes and characters tying the whole together. Some are more successful than others, and the best are transfixing. German-language novelist Kehlmann, like Tyll, is a trickster and his cheekiness is well served by Ross Benjamin’s fluid, stylish translation. The book is full of red herrings and dead ends, but it rewards close readers with grace notes and unexpected narrative connections. There’s also a dragon.

Unless you’re a student of European history, “Tyll” is likely to send you back to the annals to look up some of its real-life characters, including the Jesuit scholar and author Athanasius Kircher; Friedrich, king of Bohemia; and his wife, Elizabeth Stuart, the daughter of King James I of England. Tyll himself is a figure from German folklore, dating back to the 14th century. He’s appeared in plays, novels and a Richard Strauss tone poem that was later adapted into an opera. Kehlmann humanizes him early on in a chapter that is largely about Tyll’s father, Claus, a miller with a passion for alchemy, necromancy and the deeper mysteries of existence. Those pursuits draw the attention of two passing Jesuit priests who arrest Claus and try him for witchcraft. Rather than serve as a witness against his father, Tyll runs away. The chapter establishes the boy as a lifelong free thinker and opponent of the religious orthodoxy that is driving the war on all sides.

The visceral awfulness of the conflict is vividly portrayed in the chapter about Friedrich and Elizabeth, whose brief reign earned them the nicknames the “Winter King and Queen.” Living in exile in Holland, and suffering from the plague, Friedrich travels to solicit help from King Gustav Adolf of Sweden, whose forces are rampaging across Germany. Tyll is among Friedrich’s small retinue. Approaching the Swedish camp, they are overwhelmed with the stench: It “stank of wounds and sores, of sweat and of all diseases known to man. The King blinked. It seemed to him as if you could even see the smell, a poisonous yellow thickening of the air.” After Friedrich vomits, a soldier asks him, “Are you finished?” Tyll’s response serves as both a political and medical diagnosis: “He’s finished.”

“Tyll,” originally published in German in 2017 and already being adapted into a Netflix series, is part of a group of recent literary historical novels set in the 17th and early 18th centuries. Last year, Dexter Palmer published “Mary Toft; or, the Rabbit Queen,” a fictional retelling of a notorious hoax from the 1720s in which a woman was said to have given birth to dead bunnies. Its subject was a timely one: gullibility, fake news and alternative facts. Recently in these pages, Ron Charles reviewed Arthur Phillips’s latest novel, “The King at the Edge of the World,” about the fight to succeed Queen Elizabeth I of England. Charles noted that the struggle was, “not so different from the challenges we face in our own hyper-political times.”

Given the current geopolitical climate, it’s easy to understand why these writers were drawn to this tumultuous period in history. And it’s also no surprise that all three novels feature wit and comedy, hallmarks of the literature from that era. “Tyll” embraces this tradition, entertaining us like a jester on a tightrope and reminding us of the danger of a fall.

Jon Michaud is the author of the novel “When Tito Loved Clara.”

Tyll

By Daniel Kehlmann; translated from German by Ross Benjamin

Pantheon. 352 pp; $26.95