On a cruise ship en route to Copenhagen, Michael Armstrong (Paul Newman), an esteemed American physicist and rocket scientist, is to attend a scientific conference. Once there, he begins acting suspiciously, eventually flying to East Berlin, where he is welcomed by representatives of the East German government. His assistant and fiancée, Sarah Sherman (Julie Andrews), follows him there, believing he has defected to the other side. Sherman, however, is extremely uncomfortable with this move, realizing if the apparent defection is in fact real, given the circumstances of the Cold War of the period, she would likely never see her home or family again. They are constantly accompanied by Professor Karl Manfred (Günter Strack), who took part in arranging Armstrong's defection to the East.
It soon becomes apparent (to the viewer) that Armstrong's defection is in fact a ruse to gain the confidence of the East German scientific establishment, in order to learn just how much their chief scientist Gustav Lindt (Ludwig Donath) and by extension, the Soviet Union, knows about anti-missile systems. Armstrong has made preparations to return to the West. These plans are threatened, along with the entire escape network, known as "Pi", when he is followed to the isolated farm home of his contact by Hermann Gromek (Wolfgang Kieling), an East German security officer assigned to keep an eye him.
When Gromek confronts Armstrong about the existence of "Pi" and of his real intentions, a violent struggle ensues within the farmhouse as Armstrong realizes he must kill Gromek to keep his charade up. Gromek is stabbed, beaten with a shovel, and eventually scumbes after being shoved into a gas oven stove. Armstrong leaves while the body is buried by the "farmer" (Mort Mills) and his wife (Carolyn Conwell). The taxi cab driver (Peter Lorre Jr.) who drove Armstrong to the farm, however, reports Armstrong's suspicious behavior to the police.
The next day, Armstrong visits the physics faculty of Karl Marx University in Leipzig, where his loyalty is suspected because of the missing Gromek. The faculty try to interrogate his fiancée/assistant about her knowledge of the American "Gamma Five" anti-missile program, but she refuses to cooperate and runs from the room. At this point, Armstrong secretly confides to her his actual motives, and asks her to go along with the ruse. He finally goads Professor Lindt into revealing his anti-missile equations in a fit of pique over what Lindt believes are Armstrong's mathematical mistakes. When Lindt hears over the university's loudspeaker system that Armstrong and his fiancée are being sought for questioning by the police over the disappearance of Gromek, he realizes that he has given up his secrets while learning nothing in return. Armstrong must make a harrowing escape, along with Sherman, with the help of the university clinic physician Dr. Koska (Gisela Fischer).
Michael Armstrong and Sarah Sherman travel to East Berlin, pursued by the Stasi, in a bus operated by the Pi escape network, led by Mr. Jacobi (David Opatoshu). Roadblocks, highway robbery by Soviet army deserters, and bunching with the real bus increase the suspense. The couple escape from the bus and they have a run-in on the street with the exiled Polish countess Kuchinska (Lila Kedrova) who befriends them and agrees to help the two fugitives escape by telling them about a ship which will take them out of the country which belongs to a traveling troupe at a local theater.
Michael and Sarah go to the theater where a ballet show is playing, but they are spotted by the lead ballerina (Tamara Toumanova) who calls the police. (At the beginning of the movie, she flew to East Berlin on the same airplane as Armstrong, and mistakenly believed the press were there to greet her, rather than Armstrong.) When Armstrong sees the police moving into arrest him right inside the theater, he creates a diversion by yelling "fire" and a panic ensues. The couple escapes through the crowded theater and hide in a crate of props belonging to a traveling Czech troupe.
The troupe travels by land to a dock and to a freighter that travels across the Baltic Sea to Sweden. The Russian ballerina suspects something and she makes a mistake in uncovering where Armstrong and Sherman are hiding on the ship. She orders her Soviet guards to fire on the two crates where the couple are hiding, but the wrong crates are fired on when already dangling over the pier, and Armstrong and Sherman are able to escape by jumping overboard and swimming to a Swedish dock and are free at last.