Albert Magnoli -- director of Purple Rain and former manager to Prince himself -- revealed how the soundtrack for director Tim Burton's 1989 Batman film saved the legendary musician from dire financial straits.

"Prince was at a crossroads," Magnoli told Variety. "The Batman album afforded us the opportunity to do art and commerce and allow the artist Prince to forge on. This was a perfect opportunity and a perfect vehicle in which he could express himself creatively."

RELATED: Batman: Kim Basinger Quietly Kept Playing Vicki Vale for Years

Despite wide commercial success in the 1980s, Prince was in real danger of going broke at the time. Following the release of Purple Rain, Magnoli and Prince initially parted ways, with the latter a going on to direct his next movie, Under the Cherry Moon, for Warner Bros. After that film flopped, however, Magnoli returned at the request of The Artist's then-manager Robert Cavallo to develop a Prince documentary. It was at this point Magnoli discovered just how much Prince had been overextending himself and burning through his money.

"When he did Purple Rain and the tour, he had spent a tremendous amount of cash and he was now at a place where his management, to their credit, were attempting to leverage future earnings in order to pay for past and present debt," Magnoli revealed. "Of course, that's never a good idea, but Prince was not wanting to accept responsibility for letting these things get out of hand. And he came to me and asked, 'What if you took over?'"

Magnoli agreed to become Prince's new manager, on the conditions that the would always be allowed to be honest about his opinions (especially when the felt The Artist was making a mistake), as well as have the freedom to pursue his own creative endeavors. "He agreed to those two points, and I said okay."

RELATED: A DC Editor Once Warned Against Attempting to Make Batman Movies

"I immediately did a forensic kind of financial search as to what was really going on, and it was more horrible than anybody thought," Magnoli continued. "So, [the plan] was about trying to bring revenue into the operation without overextending him to the point where no one would be interested in getting involved in anything he wanted to do. And the Batman album came into being when I was contacted by [producer] Mark Canton, and I went to Prince and said, 'This will help us bring revenue into the system without having to expose you to another album.'"

Magnoli saw the Batman soundtrack as an opportunity for Prince to focus on being creative, meet the terms of his Warner Bros. Records contract, as well as boost his commercial stability with a blockbuster he would not have to promote himself. Additionally, Magnoli convinced Tim Burton to work with Danny Elfman on the film's score and leave Prince to his own devices to create his own collection of songs, which Burton could then add to the film however he saw fit.

Despite hitting a few snags, namely having to drastically change the music video for "Partyman" at the last minute to satisfy MTV's wishes, Magnoli's plan to get The Artist's career back to a comfortable place worked out in the end. "The revenue from Batman and severe cost cutting -- we went from $10 million per year nut to $2 million -- allowed him to continue on without concern and without changing his lifestyle."

RELATED: Tim Burton's Original Batman Script Included Another Character's Death

Prince passed away on April 21, 2016 at the age of 57, three years shy of Batman's 30th anniversary.