In Rome shortly after World War II, British Col. Michael "Hooky" Nicobar (Walter Pidgeon) is expecting a transfer home when he is instead posted to Vienna with his aides Junior Commander Audrey Quail (Angela Lansbury), Major John "Twingo" McPhimister (Peter Lawford) and Private David Moonlight (Melville Cooper). Hooky is assigned to assist Brigadier C.M.V. Catlock (Robert Coote) in monitoring possible "subversive activities" against the Allied nations and repatriating Soviet citizens living in the British zone of Vienna. He and his aides are billeted at a convent, led by the friendly Mother Superior (Ethel Barrymore). At this convent, Twingo is drawn to a ballerina calling herself Maria Buhlen (Janet Leigh). He falls for her instantly and tries to meet her, but she is reluctant to, until they are officially introduced to each other by Mother Superior.
Twingo and Maria start going out, until Soviet Colonel Piniev (Louis Calhern) reports to Hooky, announcing he is searching for a Russian ballerina named Olga Alexandrova, aka Maria Buhlen. Piniev assures Hooky that he means no harm to Olga, and that it is his order to bring her back to the Soviet Union. Later that night, Maria and the Mother Superior reveal that Maria is actually Olga, a Volga German. Shortly later, the Soviets search the entire convent, looking for Maria. Hooky does not reveal that he is aware of Maria's presence, not wanting to put the Mother Superior's image in danger. However, after the Russians leave without having found Maria, Hooky announces that he will turn her over to the Soviets the next day. After he observes Twingo trying to help Maria escape, an attempt that Maria declines because she does not want to endanger Hooky and Twingo's friendship, Hooky turns her over to the Soviets that night.
Hooky is reproved for his rigid obedience to duty by Twingo and the Mother Superior but angrily shifts responsibility for what happened to the nun. He and Twingo continue their repatriation duties and they announce to the Soviet Professor Serge Bruloff (Konstantin Shayne) that he is about to be deported; Bruloff reacts by shooting himself. Hooky claims that there is no connection between Maria's reluctance to be deported to the Soviet Union and Serge's suicide, until the third person on his list, Helena Nagard (Tamara Shayne), Serge's wife, responds by bursting into tears. When Piniev's aide tells Hooky that Bruloff's suicide was proof of "subversive activity and treasonable behavior," he starts to doubt the sincerity of the Soviets. After he witnesses Maria and Helena being forcibly deported to a harsh detainment camp, Hooky sends a brief to the War Office in London protesting the forcible repatriation of political dissidents.
On Christmas Eve, after the Mother Superior asks for his forgiveness for not treating him in a Christian manner, Hooky tells her that he lost his faith after the death of his son in combat. Catlock informs Hooky that the Soviets have sent into the British zone without authority a trainload of refugees. Hooky, enraged, goes to the train station to inspect them for subversive activities, where he witnesses the poor conditions the displaced persons are in. The Mother Superior, who accompanied him, notices Maria among the people in the train. Hooky upbraids the Soviets for their ploy, telling them he knows they staged the incident because they have no use for people too old or too young or too weak to work and are dumping them on the British. Hooky learns that Maria escaped from the Soviets and uses the technicality of her being on the train to bring her to safety and reunion with Twingo.
When Hooky and Mother Superior receive a visit from Piniev, who is looking for Maria, they refuse to co-operate. The next day, in response to his brief, Hooky is ordered to fly to Rome as a representative to a United Nations conference to end forcible repatriation, and helps Mother Superior join him to see the Pope on the same issue. On his return, he and Catlock are informed by Piniev that unless Maria is surrendered immediately, the Soviets will cease cooperating with the British on all other matters. Catlock orders Hooky to do so but he refuses and is fired him from his job. Meanwhile, Twingo and Maria plan on moving to Scotland, when she is suddenly captured by Hooky's replacement, the pompous and rigid Colonel Omicron, who intends to turn her in to Piniev. Realizing her fate, she jumps out of a window and succumbs to her injuries. Shortly after, Hooky is assigned to an operation called "Humanizing the Army" and forcible repatriation is ended.