Princess Ozma is the ruler of Oz who appears as a minor and later major character in the Oz books and a supporting character in Return to Oz.
Return to Oz
The film, which was based loosely on the books Ozma of Oz and The Marvelous Land of Oz, reveals that Ozma's father was the king of Oz before the Wizard came, and Mombi made Ozma her slave. When the Nome King took over Oz and promised Mombi the heads of 30 women (to switch heads with) if she kept her a secret, she imprisoned her within the mirror. Somehow, she is able to appear outside Oz and talk to Dorothy at Dr. Worley's clinic as a fellow patient. She appears to her as one of the patients to comfort her and gives her a jack o' lantern (a reference to Jack Pumpkinhead) as Halloween is coming up and disappears. After discovering that some of his patients have been damaged by his machines and locked in the cellar, she rescues Dorothy from the clinic, but Nurse Wilson discovers and chases after them, resulting in them both falling into the river. Ozma vanishes, and seemingly drowns; presumably she returns to her position in Oz, which was inside the mirror.
She later reappears to show Dorothy the way out of Mombi's mirror room when Dorothy takes Powder of Life from Mombi's cabinet containing her original head and escape her. When Dorothy escapes, Mombi taunts Ozma in the mirror stating she is the only one who knows where she is and no one will help her escape. After the Nome King was destroyed and Oz restored to its original state, Dorothy frees Ozma from the mirror, and Ozma reclaims her position as the rightful ruler of Oz. She is also revealed to be the creator of Jack Pumpkinhead, who calls Ozma his mother. She uses the Ruby Slippers to send Dorothy back home to Kansas, saying she would look in on her from time to time and take her back to Oz if she wishes to return. Afterward, Dorothy sees Ozma in her bedroom mirror, indicating that Oz was not a dream (as both movies initially implied).