The most surprising part of the Starz adaptation of Neil Gaiman’s American Gods is not how the show has handled the novel’s often surreal sex scenes or added entirely new characters. Rather, it’s how the show taken one of the novel’s bit parts — a grumpy leprechaun — and transformed him into one of the story’s most fascinating characters.

American Gods revolves around a brewing conflict between the old golds from mythology and new objects of American worship like the internet or media. Mad Sweeney (Pablo Schreiber) is one of the old gods, or at least their reluctant flunky. He’s a tall and uncouth leprechaun prone to starting fights and sneering at other people’s sex lives. In the novel, he only appears in a few scenes. He doesn’t add anything profound to the story beyond the flash and color of his presence.

The seventh episode of the show, however, has infused him with surprising depth and soul and revealed his intriguing origins.

Pablo Schreiber as Mad Sweeney in 'American Gods' Starz

As Mad Sweeney tells Laura in “Prayer for Mad Sweeney,” he used to be a king. He was a man “of the mounds” whose believers left tokens of food and gold in exchange for good fortune. As the years went by, Irish lore turned his kind into “saints and trolls and fairies.” Casting a sardonic look with one of his red eyebrows raised, he explains that in the ensuing years, “General Mills did the rest.”

In the show’s current timeline, he’s a creature with diluted powers and a bad attitude. He’s doing dirty work for Wednesday, a man who freely calls him “a fucking idiot,” he’s lost his lucky coin, and he lives in a world that mostly thinks of him as a cartoon on a cereal box.

But let’s return to his “I was a king once” line. Although the show does not expand upon it, this refers to the Irish legend of Buile Shuibhne, which is also known as “The Madness of Suibhne, or “Suibhne’s Frenzy.” The earliest manuscript version was written in 1629 by Michael O’Clery, but the tale traces back centuries. The basic story is of a king who inadvertently angers Saint Ronan, is subsequently cursed and driven insane, and wanders for years until he dies.

In the show, when Mad Sweeney tells Laura about his vision of his death in battle, the carnage shown onscreen is the Battle of Mag Roth, also known as the Battle of Moira, in A.D. 637.

Mad Sweeney and Laura Moon in 'American Gods' Starz

Although he’s technically one of the “Old Gods,” then, Mad Sweeney has been just as used and manipulated by divine factors as any human. He occupies a liminal space between gods and mortals; between those who pull the strings and those like Shadow who just want to know what the hell is going on.

It’s all the more impressive that he’s able to muster compassion for Laura by the end of “Prayer for Mad Sweeney.” As Shadow can attest, when your life seems cursed, it’s hard to muster a smile about the small things like marshmallows in hot chocolate.

American Gods Season 1 is currently airing Sunday nights on Starz.