WARNING: The following contains spoilers for Disney's Aladdin remake, as well as the comic anthology Aladdin: Four Tales of Agrabah, by Corinna Bechko, Pablo Andres, Lalit Kumar Sharma, Diego Perez Galindo, Jordi Escuin Llorach, DC Alonso, Richard Starkings and Jimmy Betancourt, on sale from Dark Horse.

Disney's beloved 1992 animated film Aladdin didn't really dive into Genie's backstory. Fans enjoyed Robin Williams' performance, but all we discerned was that Genie's past was filled with bad owners, one of which left him yearning freedom from the lamp.

RELATED: Aladdin's New Ending Actually Improves Upon the Original

However, for Disney's live-action adaptation, Dark Horse Comics has provided a glimpse into the history of Will Smith's magical character. What the comic book prequel does, apart from giving us a snapshot of Genie's life a thousand years before he met Aladdin, is also highlight the person he considers his best master, who taught him a valuable life lesson.

This comes in the shape of a girl named Zayna in Agrabah. The story "Duty & Dreams" finds her running home to show her mother the lamp she bought at the market, hoping it's magical like those in her bedtime stories. The mother is disappointed, however, as Zayna was supposed to spend that money on food. But as the girl polishes the relic, Genie appears, ready to make her wildest dreams come true.

RELATED: How Will Smith Overcame His Fear of Playing Genie in Aladdin

Zayna's first wish is to own a big business to make money for her family, but she soon realizes there's too much hard work involved. She then uses the second wish to become wealthy, which Genie expected, because all of his masters usually choose that first. That's why he has such a low regard for humanity. His doubts are quickly proved wrong by Zayna's final wish, which speaks to her kind spirit.

She's unhappy with her life of wealth because she doesn't get to spend time with her family, as they're too busy with the lavish lifestyle. Zayna doesn't enjoy her time with housekeepers and babysitters, and finally understands that wealth isn't all that it seems. True happiness comes from within, and so she asks Genie to return her life to how it was before they met. He's confused, and asks her if she would like to be a princess, but she insists she wants back her life of poverty, which will inspire her to study harder, sacrifice and earn her money.

RELATED: Disney's Aladdin Prequel Gives Princess Jasmine a New Backstory

Genie does just that, and in the process, he returns to the lamp, leaving the girl happier than ever. Zayna has her family at her side, and is focused on her academics once more, ironically using the lamp as a paperweight in her study. She keeps Genie a secret, and moves on with life. However, before he departs, it's clear Zayna restored Genie's faith in mankind. She's likely the reason he'll go on to connect with a kindred spirit in Aladdin. Of course, the bar is set quite high, because Zayna's selflessness and unflinching love for family left Genie in wonder.

Directed by Guy Ritchie, Aladdin stars Mena Massoud as Aladdin, Will Smith as Genie, Naomi Scott as Princess Jasmine, Marwan Kenzari as Jafar, Navid Negahban as the Sultan of Agrabah, Billy Magnussen as new character Prince Anders, and Frank Welker and Alan Tudyk as the voices of Abu and Iago, respectively.