In Seattle, Washington, Zack Mayo finds his father, Byron Mayo, in bed with a prostitute. Remembering his youth, Zack recalls meeting Byron in the Philippine Islands, where his father was stationed with the United States Navy. Zack’s mother had recently committed suicide and the boy blamed his father for deserting them. Although Byron was an alcoholic philanderer, who wanted to avoid his parental responsibilities, Zack protested going home and raised himself in a community of prostitutes and thieves. Now grown up, Zack announces to his father that he is joining the Navy to become a pilot. Despite Byron’s objections, Zack drives his motorcycle to the Port Rainier Naval Air Station and joins a group of new recruits. Drill instructor Sergeant Emil Foley warns the men and women that they must devote six years of their lives to the Navy and reprimands enlistee Sid Worley for failing to refer to him as “Sir.” When Zack snickers at Foley’s sexually suggestive language, Foley yells at him for looking him in the eye. Foley cautions the recruits that he will use any means necessary to weed out those who are unworthy of being pilots. Meanwhile, at a nearby paper factory, employees Paula Pokrifki and Lynette Pomeroy finish their work and head to the base to look for mates. With shaved heads and new uniforms, the recruits file into their rooms, then follow Foley’s command to line up outside. When a young woman named Casey Seeger laughs at Sid and Zack’s comments about people who feign pregnancy as an excuse to get married, Foley punishes them with fifty push-ups. Paula and Lynette walk past and tell Zack and Sid that they’ll see them in a month’s time when they are on “liberty.” During training, Foley pushes the endurance of his class and complains they are the worst he has ever seen. Back in the dormitory, Zack’s roommate, Perryman, warns that Zack’s covert operation, polishing boots and belt buckles for cash, will get the whole unit expelled. While Zack excels at physical training, he struggles with his academic studies and when Sid discovers Zack buying polished boots and buckles from a middleman, the friends agree that Sid will help Zack pass Aerodynamics in return for free goods. Later, at a dance, Zack and Sid reunite with Paula and Lynette. While Sid and Lynette discover they both have brothers who died in the Vietnam War, Paula encourages Zack to fulfill his dream of becoming a pilot and they kiss. Sometime later, the ladies meet Zack and Sid at a bar, but the men are hassled by locals and Zack breaks a man’s nose. After driving to the Tides Inn motel, Zack regrets the fight and rejects Paula’s attempt to console him, but, after Zack apologizes, the couple spends the night together. Back at the base, trainee Topper Daniels panics in a plane crash simulator and Foley dives into the water to save him. After Topper willingly drops out of the class, Foley inspects the dorm room to discover the stashed inventory from Zack’s covert business. When Zack refuses to withdraw from training, Foley vows to break the young man’s will by subjecting him to a weekend of abuse. As Zack works out in a pool of mud, Foley tells the young man that his childhood experiences have guided his life on a course of failure. At the end of the weekend, Zack remains resolute. Although Foley decides to expel him anyway, Zack cries that he has nowhere to go and Foley agrees to give him another chance. Back at the Tides Inn, Zack and Paula make love. Zack reveals that his mother overdosed, but when he claims to be unaffected by her suicide, Paula does not believe him. Later, on a ferryboat, Lynette admits to Paula that she has considered getting pregnant to trap Sid into a marriage. After an uncomfortable dinner with Paula’s family, Zack tells her that he will move to a base in Penascola, Florida, after graduation in three weeks. When Zack says he has no interest in marriage and family, Paula shows him a picture of her “real father,” a Naval officer candidate who left her mother. The next weekend, as Zack is dismissed on “liberty,” Paula calls him from the factory, but he refuses to answer. Although Paula is determined to go after Zack, her mother, Esther, stops her, warning that Paula might resort to dishonesty to “trap” him. After dinner with Sid’s parents, a Naval captain and his wife, Zack learns that his friend is planning to marry Susan, a girl who was engaged to his brother before he died in Vietnam. When Sid admits he has a date with Lynette that evening, Zack suggests that his friend “break it off clean” with Lynette the way he did with Paula. At a bar, Zack sees Paula flirting with a flight instructor and although he apologizes, she leaves with her date. Meanwhile, at the Tides Inn, Sid asks Lynette about her late period and she swears that, if pregnant, she would take responsibility for it herself. Back at the base, Sid tells Zack that Lynette’s pregnancy is confirmed by a doctor and she refuses to get an abortion because she is Catholic. When Sid says he will marry her out of duty, Zack suggests that his friend takes too much responsibility for others, including the death of his brother. Later, during a training exercise in an oxygen decompression chamber, Sid panics and refuses to put his mask on. Zack comes to his rescue, but Foley is not impressed and Sid is expelled. When Zack swears at Foley, claiming that Sid is the best candidate in the class, Sid admits that he voluntarily dropped out and says he was only in training because of his brother. Sid takes a cab to Lynette’s house after spending his life savings on a wedding ring, but when she learns he is no longer an officer candidate, she says she is not pregnant. Although Sid still wants to get married, Lynette refuses, explaining that she only wants to marry an officer so she can live overseas. Meanwhile, Zack picks up Paula to look for his friend and she takes him to see Lynette, who tells them she rejected Sid. Checking into the Tides Inn motel, Sid swallows the engagement ring with a bottle of alcohol, and, soon after, Zack and Paula discover his dead body hanging in the shower stall. Outside, Paula consoles Zack and reminds him that he is not responsible for the deaths of his mother and Sid. Although Zack tries to brush her off, Paula argues that she is not like Lynette. When she declares her love for him, Zack runs away, claiming that he does not want to be loved. At the base, Zack requests to see Foley privately, and when Foley refuses, Zack threatens to quit. Challenging Zack to a fight, Foley is surprised by Zack’s skills, but he overcomes Zack by kicking him in the groin. As Zack lies on the ground, Foley permits him to drop out of training. However, at the candidate’s graduation ceremony, Zack takes a pledge of allegiance with his class and, upon Foley’s order, they toss their hats in celebration. When Foley personally congratulates his graduates with their first official salutes, Zack tells the drill instructor that he would not have made it through without him. As Zack drives away, he sees Foley initiating a new class using the same orders he heard on his first day. In his officer’s uniform, Zack strides through the paper factory to collect Paula and, as he carries her away, her fellow workers, including Esther and Lynette, applaud.