The following contains spoilers for Puss in Boots: The Last Wish, now in theaters.

Puss in Boots: The Last Wish owes its surprising success to the way it captures the fractured fairy tale energy of the first two Shrek movies. But it also endeavors to tell its own story, with Antonio Banderas's swashbuckling feline occupying a very different corner of the universe than his green ogre companion. Spain remains his stomping grounds, and the new film is firmly set in a very Spanish locale.

Indeed, Sergio Leone's spaghetti Westerns play a large role in The Last Wish, bringing a whiff of amoral gunslingers to its various nursery rhyme critters. Nowhere is this more true than Puss's greatest nemesis: Death himself, wearing the shape of The Big Bad Wolf. He announces himself with an appropriate "wolf whistle" that evokes Leone's movies as much as the film's dusty landscapes and tension-laden showdowns.

RELATED: Puss in Boots: The Last Wish's Emotional Ending, Explained

The Spaghetti Westerns Make Strong Inspiration for Puss in Boots

Once Upon A Time In The West image of cast

Puss in Boots was originally an Italian creation. The Shrek movies reimagined him as a Spanish swordsman, actively sending up Banderas's celebrated performance as the lead in The Mask of Zorro. It makes a weirdly fitting parallel for Leone: an Italian filmmaker who often shot his pictures in Spain. (The Tabernas Desert and other Spanish locations made an apt stand-in for the American Southwest.) Both the original Puss in Boots movie and The Last Wish echo the look, with Puss's adventures taking place amid desert landscapes and lonely white-painted towns.

The rest of the film aptly follows suit. Though played strictly for laughs, there are few real heroes in The Last Wish. Puss's nemeses -- including "Big" Jack Horner and the Goldilocks crime family -- are all self-serving criminals. They follow no law save their own and come into conflict over resources to which they all feel entitled. The Leone films perfected such morally dubious figures and often set them against each other in a manner very similar to The Last Wish. Puss himself has always been a mercenary at heart (he is a cat, after all), and like Leone's protagonists, he's more concerned with survival than doing the right thing.

RELATED: Puss in Boots: The Last Wish Turns John Mulaney's Villain Into Comedy Gold

Puss in Boots' Wolf Uses a Familiar Calling Card

Puss in Boots Last Wish Wolf Death 3

The theme extends to Death, who holds a grudge against Puss for frivolously wasting eight of his allotted nine lives. He periodically menaces the cat by giving out a low menacing whistle as he approaches, and Puss soon finds he has no defense against the wolf's ferocity. The whistle becomes a key part of the character, not only because of the play on words but by connecting the character to Leone's mythology.

Music plays a huge role in Leone's films, from famous scores by Ennio Morricone to the way the characters interact with music within the story. That includes films like For a Few Dollars More, where the villain uses a musical stopwatch to announce his murders. More famously, Charles Bronson's character plays the harmonica in Once Upon a Time in the West, often right before he shoots someone dead. Leone borrowed the concept from Fritz Lang's M, in which Peter Lorre's serial killer whistles a tune before he strikes. In time, it's become an integral part of what makes his westerns unique.

The wolf whistle puts The Last Wish's Death in the same company, not only for what he foretells but as a shorthand way to develop his character. The movie is surprisingly full, with several memorable characters competing for attention. Adding this touch to its biggest and baddest nemesis helps him stand out from the others. It's very much in keeping with the film's nod to Leone as well, making him firmly of a kind with this universe. Leone understood how much meaning could go into something so simple, a trick The Last Wish adroitly duplicates.

To see hear the wolf whistle at work, Puss in Boots: The Last Wish is now playing in theaters.