At a formal ball in Washington D.C., U.S. Navy Lieutenant Commander Tom Farrell (Kevin Costner) meets a young woman, Susan Atwell (Sean Young). The two immediately begin an affair when they have quick sex in the backseat of Farrell's limosine and later at Susan's apartment. Although Farrell is clearly in love, it is implied that Susan is involved with someone else.
During his next Naval deployment to the Phillippines, Farrell rescues a sailor from his ship during a storm and becomes a hero. He is brought back to Washington to work at the Pentagon in the Office of the Secretary of Defense. Secretary of Defense David Brice (Gene Hackman) is aware that his General Counsel Scott Pritchard (Will Patton) is an old friend of Farrell's. Brice is attempting to cancel a white elephant "Phantom Sub" project that has powerful political backing. Brice decides that Farrell should act as his direct liaison to the CIA. The real purpose is to gather information about whether the Soviets really are working on such a project.
Soon after, Farrell finds out that the other man in Susan's life is Secretary Brice. However, Brice in turn learns of Susan's infidelity. While demanding the name of her new lover, he slaps Susan in a jealous rage and fatally knocks her off an indoor balcony.
Ready to turn himself in, Brice is persuaded by Pritchard to cover up everything and blame it on someone else. They concoct a story that claims Susan's other lover was in fact a KGB sleeper agent code-named "Yuri." In the aftermath, they focus all attention on an attempt to capture him. Confident that "Yuri" doesn't exist, Director of Central Intelligence Marshall (Fred Dalton Thompson) dismisses the possibility of it being Pritchard having an affair with Susan, saying that Pritchard is homosexual.
Brice appoints the unknowing Farrell to lead the investigation to find Susan's other lover; the KGB spy. Farrell is thus placed in the position of attempting to find evidence that could falsely implicate himself. The only forensic evidence in the case is a badly damaged Polaroid negative recovered from Susan's house, which requires lengthy computerized processing to become visible. Aware that it is his face on the blurred photo, Farrell pleads with systems analyst Sam Hesselman, an old friend, to slow down the processing and confides in him about his secret affair with Susan Atwell. While the processing takes place, Farrell sets about re-directing attention back onto Brice. He does this by searching government printouts for evidence that Brice gave Susan a present which was a government-registered gift from Morocco.
Pritchard harasses Nina Beka, a close friend of Susan's, by threatening deportation back to South Africa. Then he sends covert assassins to "take care of" her. Farrell comes to Nina's rescue just in time.
A suspicious Sam goes to Pritchard with concerns about what Farrell told him. Realizing that Sam can implicate Brice, Pritchard shoots him in cold blood.
A race develops between two pieces of evidence: the processing of the picture implicating Farrell and a printout of the gift's registration implicating Secretary Brice. Farrell obtains the printout first and confronts Brice with the evidence. Brice shifts the blame to Pritchard, arguing that Pritchard was jealous of his relationship with Susan. A devastated Pritchard commits suicide with a pistol right there in his office. When the military police enter, the guilt-ridden Brice then turns himself in as being the one who killed Susan Atwell and that her KGB lover never existed.
The film ends with a surprising plot twist. Several days later, Farrell is mourning at Susan's grave when two plainclothes men arrive and take him away for questioning to a local hotel where another man emerges from behind a two-way mirror. The interrogator is Farrell's landlord Mr. Schiller (Michael Shillo). After a few moments, he addresses Farrell in Russian and Farrell responds in kind. Farrell is, in fact, the real "Yuri," and his landlord is his KGB supervisor and handler. Yuri/Farrell was planted in the U.S.A. as a teenager and became the "mole" in the Department of Defense this whole time. As the KGB was aware of Brice's affair, Farrell was assigned to seduce Atwell and gather intelligence from the Secretary of Defense's mistress. Although his handlers demand that he return to the Soviet Union immediately since his cover was nearly blown, Farrell refuses and leaves. The KGB agents are about to chase after him when Schiller stops them and tells them to let Farrell go for the time being. Schiller quips: "He'll be back. Where else does he have to go?"