The Wizard of Oz
In 1939, Hamilton played the role of the Wicked Witch of the West, her most famous role. Hamilton was cast after Gale Sondergaard, who was first considered for the role, albeit as a more glamorous witch with a musical scene, declined the role when the decision was made that the witch should appear ugly.
On December 23, 1938, Hamilton suffered an on-set accident. During a second take of her fiery exit from Munchkinland, the trap door's drop was delayed to eliminate the brief glimpse of it seen in the final edit, causing her to receive a second-degree burn on her face and a third-degree burn on her hand. She had to recuperate for six weeks after the accident, before returning to the set to complete her work on the film. After she recuperated, she said, "I won't sue, because I know how this business works, and I would never work again. I will return to work on one condition—no more fireworks!" Garland visited Hamilton while the latter recuperated at home, looking after Hamilton's son.
Studio executives cut some of Hamilton's more frightening scenes, worrying they would scare children too much. Later in life, she would comment on the role of the witch in a light-hearted fashion. During one interview, she joked:
I was in need of money at the time, I had done about six pictures for MGM at the time, and my agent called. I said, 'Yes?' and he said 'Maggie, they want you to play a part on the Wizard.' I said to myself, 'Oh, boy, The Wizard of Oz! That has been my favorite book since I was four.' And I asked him what part, and he said, 'The Witch', and I said, 'The Witch?!' and he said, 'What else?'
On February 11, 1939, Hamilton's stand-in and stunt double, Betty Danko, also suffered an on-set accident. Instead of Hamilton, Danko made the fiery entrance to Munchkinland. During the "Surrender Dorothy!" skywriting sequence at the Emerald City, Danko sat on a smoking pipe configured to look like the Witch's broomstick. The pipe exploded on the third take of the scene. She spent 11 days in the hospital and her legs were permanently scarred. The studio hired a replacement stunt double, Aline Goodwin, to finish the scene.
When asked about her experiences with her role in The Wizard of Oz, Hamilton said she was afraid that it would give children a wrong idea of who she really was, since she actually cared deeply about children, frequently giving to charitable organizations. She often remarked about children coming up to her and asking her why she had been so mean to Dorothy. She appeared on an episode of Mister Rogers' Neighborhood in 1975 where she explained to children she was only playing a role and showed how putting on a costume "transformed" her into the witch. She also made personal appearances, and Hamilton described the children's usual reaction to her portrayal of the Witch:
Almost always they want me to laugh like the Witch. And sometimes when I go to schools, if we're in an auditorium, I'll do it. And there's always a funny reaction, like 'Ye gods, they wish they hadn't asked.' They're scared. They're really scared for a second. Even adolescents. I guess for a minute they get the feeling they got when they watched the picture. They like to hear it but they 'don't' like to hear it. And then they go, 'Ooooooh ... !' The picture made a terrible impression of some kind on them, sometimes a ghastly impression, but most of them got over it, I guess ... because when I talk like the Witch, and when I laugh, there is a hesitation and then they clap. They're clapping at hearing the sound again.
In By Your Leave (1934), she played the housekeeper of one of her castmates from The Wizard of Oz, Frank Morgan, and in Saratoga (1937), she has a colloquy with Morgan regarding a cosmetic product he invented, with side glances and eye rolls by Morgan as to its effect on her "beauty". One of Hamilton's lines from The Wizard of Oz—"I'll get you, my pretty, and your little dog, too!"—was ranked 99th in the 2005 American Film Institute survey of the most memorable movie quotes. Her son, interviewed for the 2005 DVD edition of the film, commented that Hamilton enjoyed the line so much, she sometimes used it in her real life.
A few months after filming Oz, she appeared in Babes in Arms (1939) as Jeff Steele's aunt, Martha, a society do-gooder who made it her goal to send the gang of child actors, led by Mickey Rooney and Judy Garland, to a work farm. In 1945, she played the psychotic sister of Oz co-star Jack Haley in George White's Scandals, trying to prevent him from marrying his fiancé, played by Joan Davis, even going so far as attempting to kill her with an axe. Hamilton and Ray Bolger were cast members in the 1966 fantasy film The Daydreamer, a collection of stories by Hans Christian Andersen. A few years later, they were reunited on Broadway for the short-lived musical Come Summer.