During a period in which he was just beginning to deeply explore the pitched battles between good and evil, Prince found Batman and the Joker to be the perfect proxies.

His Batman album was more than a soundtrack to the film of the same name. It was a complete refashioning of the story, one that replaced darker fantasies for the action-adventure associated with blockbuster films from the world of comic books.

Prince had, of course, been straddling the same moral line for years. Songs like "Partyman," released as a single on Aug. 25, 1989, gave him an opportunity not just to revel in our baser impulses, but to inhabit another character entirely.

Paired on the big screen as the Joker runs amok through an art exhibit, "Partyman" quickly moves from descriptive verses ("All hail, the new king in town ... the funkiest man you've ever seen") to a marked personalization ("I rock the party, I rock the house; I rock the whole world, north, east and south"). By the end, the Joker and Prince have become one and the same.

This identity crisis was, in fact, part of the song's DNA – dating to long before Prince was associated with the Tim Burton-directed 1989 film. "We started seeing dailies, and it so happened that the Joker character was dressed in purple," Gary LeMel, president of Warner Bros. Music, once told Billboard. "The cars were purple. It started to point to Prince."

The introductions came easy, since Prince was then under contract with Warner Bros., the same company producing Batman. Moreover, his manager at the time was Albert Magnoli, who'd directed Purple Rain for Warners.

Prince took the Concorde to London in January of 1989 to meet with Tim Burton at his Pinewood Studios set. There, he learned that the director had been listening to Prince music while filming. Burton had even included the earlier Prince songs "1999" and "Baby I'm a Star" in a rough cut of the movie.

In Prince: Inside the Music and the Masks, co-producer Jon Peters said the idea was for Prince would compose "for the dark characters only." That ended up working just fine for Prince. Jack Nicholson, a long-time fan, had recommended Prince – and, in turn, Prince saw something of himself in Nicholson's portrayal of the Joker.

"Partyman" was sparked, in fact, by their first in-person meeting. "He just walked over, sat down and put his foot up on a table – real cool," Prince told Rolling Stone. "He had this attitude that reminded me of Morris [Day] — and there was that song."

Sufficiently intrigued, Prince canceled a planned Paris vacation and set about writing back in Minneapolis. By the time he returned, however, Tim Burton's vision for the film was coming into sharper focus. He ultimately rejected a few of Prince's song suggestions.

"Electric Chair" and "Vicki Waiting," a reworked version of a track originally titled "Anna Waiting," made the cut. Burton passed on Prince's main theme, "Rave Un2 the Joy Fantastic" (considered as a replacement for "1999" in the gallery scene) and "200 Balloons" – the latter of which was later reworked into the chart-topping single "Batdance."

"Partyman" didn't quite match that kind of Billboard success, finishing just inside the Top 20, but it served as Prince's centerpiece moment in the film. It also highlights, once again, the dichotomy found in so much of his work: As Prince's endlessly fun, electro-funky anthem plays, the Joker goes on a brutal rampage through the winkingly named "Flugelheim" Museum. ("Gentlemen," an ever-hammy Nicholson announces, "let's broaden our minds!") The villain and his henchmen proceed to vandalize a series of priceless works of art, including a 1669 self-portrait of Rembrandt, before they stop short at Francis Bacon's "Figure With Meat." This scene's cognitive dissonance is just perfect.

Burton continued making his own judicious cuts. In the end, he'd principally rely upon an orchestral score from Danny Elfman, despite significant pressure to create more corporate synergy by using Prince's music throughout the film. Other than "Trust," which arrived during another scene focused on the Joker, most of the rest of Prince's work found its way to the cutting-room floor. "The Future," for instance, became a piece of incidental music, heard blaring out of a passing car.

Prince wasn't ready to give up on his vision, either. He included both the accepted and rejected songs on the 1989 album Batman, creating a sort of alternate storyboard. Meanwhile, Burton said he'd never submit to such an arrangement again. Still, despite that friction, the pairing worked. Batman became one of the biggest-grossing movies in history, while Prince saw his companion album go double platinum.

As the LP soared to No. 1 – it was Prince's first since 1985's Around the World in a Day – careful liner-note readers discovered one more intriguing nugget inside: The vocals on "Partyman" – as well as "Electric Chair" and "Trust" – were attributed not to Prince, but to the Joker.

Ranking Every Prince Album

More From Ultimate Prince