Maria is a free-spirited young Austrian woman studying to become a nun at Nonnberg Abbey in Salzburg in 1938. Her love of music and the mountains, her youthful enthusiasm and imagination, and her lack of discipline cause some concern among the nuns. The Mother Abbess, believing Maria would be happier outside the abbey, sends her to the villa of retired naval officer Captain Georg von Trapp to be governess to his seven children-Liesl, Friedrich, Louisa, Kurt, Brigitta, Marta, and Gretl. The Captain has been raising his children alone using strict military discipline following the death of his first wife. Although the children misbehave at first, Maria responds with kindness and patience, and soon the children come to trust and respect her.
While the Captain is away in Vienna, Maria makes play clothes for the children and takes them around Salzburg and the surrounding mountains, and she teaches them how to sing. When the Captain returns to the villa with Baroness Elsa Schraeder, a wealthy socialite, and their mutual friend, Max Detweiler, they are greeted by Maria and the children returning from a boat ride on the lake that concludes when their boat overturns. Displeased by his children’s clothes and activities, and Maria’s impassioned appeal that he get closer to his children, the Captain orders her to return to the abbey. Just then he hears singing coming from inside the house and is astonished to see his children singing for the Baroness. Filled with emotion, the Captain joins his children, singing for the first time in years. Afterwards, he apologizes to Maria and asks her to stay.
Impressed by the children’s singing, Max proposes he enter them in the upcoming Salzburg Festival but the suggestion is immediately rejected by the Captain as he does not allow his children to sing in public. He does agree, however, to organize a grand party at the villa. The night of the party, while guests in formal attire waltz in the ballroom, Maria and the children look on from the garden terrace. When the Captain notices Maria teaching Kurt the traditional Landler folk dance, he cuts in and partners with Maria in a graceful performance, culminating in a close embrace. Confused about her feelings, Maria blushes and breaks away. Later, the Baroness, who noticed the Captain’s attraction to Maria, hides her jealousy while convincing Maria that she must return to the abbey. Back at the abbey, when Mother Abbess learns that Maria has stayed in seclusion to avoid her feelings for the Captain, she encourages her to return to the villa to look for her life. After Maria returns to the villa, she learns about the Captain’s engagement to the Baroness and agrees to stay until they find a replacement governess. The Captain’s feelings for Maria, however, have not changed, and after breaking off his engagement the Captain and Maria are married.
While they are on their honeymoon, Max enters the children in the Salzburg Festival against their father’s wishes. When they learn that Austria has been annexed into the Third Reich in the Anschluss, the couple return to their home, where a telegram awaits informing the Captain that he must report to the German Naval Headquarters in Bremerhaven to accept a commission in the German Navy. Strongly opposed to the Nazis and the Anschluss, the Captain tells his family they must leave Austria immediately. That night, as the von Trapp family attempt to leave, they are stopped by German soldiers waiting outside the villa. When questioned by Gauleiter Hans Zeller, the Captain maintains they are headed to the Salzburg Festival to perform. Zeller insists on escorting them to the festival, after which his men will accompany the Captain to Bremerhaven.
Later that night at the festival, during their final number, the von Trapp family slip away and seek shelter at the nearby abbey, where Mother Abbess hides them in the cemetery crypt. Nazi soldiers soon arrive and search the abbey, but the family is able to escape using the caretaker’s car. When the soldiers attempt to pursue, they discover their cars will not start as two nuns have removed parts of their engines. The next morning, after driving to the border, the von Trapp family make their way on foot across the mountains into Switzerland to freedom.