In 1923 Tennessee, two young boys, Rafe McCawley (Ben Affleck) and Danny Walker (Josh Hartnett), are playing together in the back of an old biplane, pretending to be soldiers fighting the Germans in World War I. After Rafe's father lands his biplane and leaves, Rafe and Danny climb into the plane and Rafe accidentally starts it, giving the boys their first experience at flight. Soon afterward, Danny's father (William Fichtner) comes to take him home, and beats Danny. In an effort to protect Danny, Rafe hits Danny's father with an old propeller. Rafe threatens to beat him further and calls him a "dirty German". Danny's father's reacts by saying he fought the Germans in the trenches in France during World War I, and that he prays that no one will ever have to see the things he saw. He then walks into the wheat fields, and Danny tells Rafe that he is his best friend, before rejoining his father.
Eighteen years later, in January 1941, Danny and Rafe are both First Lieutenants under the command of Major Jimmy Doolittle (Alec Baldwin). The two men get into trouble when they use Air Corps P-40 fighters to play a game of chicken at Mitchel Field, Long Island. Afterwards, after Doolittle chews him out, he gives Rafe the news that he has been accepted into the Eagle Squadron (an RAF outfit for American pilots to fight during the Battle of Britain). Rafe lies to Danny, though, saying that Doolittle had assigned him.
While on a train ride to New York, a nurse named Evelyn (Kate Beckinsale) tells her fellow nurses Sandra (Jennifer Garner), Betty (Jaime King), Martha (Sara Rue) and Barbara (Catherine Kellner) the story of how she had met Rafe four weeks earlier after passing his medical exam, even though Rafe suffers from dyslexia. The two had begun a relationship and Evelyn is looking forward to seeing Rafe in the city that night. Rafe and Evelyn enjoy an evening of dancing at a nightclub and later a spin in New York harbor in a borrowed police boat. Later, Rafe shocks Evelyn by saying that he has joined the Eagle Squadron and is leaving the next day. He asks her not to see him off, but when he leaves the following morning, he is pleased to see that she has come anyway, as it means she loves him.
Meanwhile, Danny, Evelyn and the rest of their fellow pilots and nurses are transferred to Pearl Harbor, where there is little action going on; meanwhile, Rafe flies in numerous dogfights with the RAF against the Luftwaffe. During one battle, Rafe is shot down over the English Channel and presumed to be killed in action. Danny gives Evelyn the news and she is devastated. They spend the evening together, talking about Rafe. Danny learns that Rafe volunteered to go to England.
Three months later, Evelyn runs into Danny at a movie theater, after they both leave after they see a news reel of British planes being shot down into the English Channel. They get coffee at a nearby diner and talk about Rafe. They soon realize they are developing feelings for each other. Danny later takes Evelyn for a sunset flight over the harbor, and afterwards they passionately kiss in a parachute hangar and begin a relationship of their own.
On the night of December 6, Evelyn is relieved to discover Rafe, alive and well, standing outside her door. He explains that he survived his plane crash and was rescued by a French fishing boat, and was stuck in occupied France ever since. Danny comes soon afterward holding a telegram from Western Union stating that Rafe is in fact alive. Rafe realizes that Danny and Evelyn are now together and, feeling hurt and betrayed, leaves. He goes to the Hula bar where he is welcomed back by his overjoyed fellow pilots. Danny follows him, and they get into a fight with each other. When the police arrive, the two drive away and, after talking, eventually fall asleep in their car.
Early the next morning, on December 7, 1941, the Japanese navy begins its attack on Pearl Harbor. The two drive away in search of a still standing airfield, while Evelyn and the other nurses rush for the hospital, where they struggle to give emergency treatment to hundreds of injured, some of whom must be turned away because they cannot be saved. Rafe and Danny manage to get in the air in two P-40s, shooting down seven Japanese Zeroes. After landing, Danny and Rafe return to the hospital where a bedraggled and exhausted Evelyn draws blood from the two men for the hundreds of wounded men and women, but is interrupted when a man comes in and asks Danny and Rafe to assist in rescuing men from the harbor. The next day, President Franklin Delano Roosevelt (Jon Voight) delivers his Day of Infamy Speech to the nation and asks the US Congress to declare a state of war with the Empire of Japan.
In the aftermath, the survivors attend a memorial service to honor the numerous dead, including Betty. Later, Danny and Rafe are assigned to travel stateside under Major Doolittle for a secret mission. Before they leave, Evelyn goes to see Rafe. She reveals that she is pregnant, though she does not want Danny to know. She tells Rafe that she will stay with Danny, but she will also love Rafe for the rest of her life.
Upon their arrival in California, Danny and Rafe are both promoted to captain and are awarded the silver star. Doolittle asks them to volunteer for a top secret mission, which they both immediately accept, despite knowing that it is quite likely they will never return. While sitting at a bonfire on a beach, Rafe pleads to Danny to not go on the mission, that he has nothing to prove, but Danny decides to go anyway, thinking that Rafe is just trying to protect him. During the next two months, Rafe, Danny and other pilots train with specially modified B-25 Mitchell bombers, learning how to launch them with only 467 feet of runway. In April, the raiders are sent towards Japan on board USS Hornet, and are informed that their mission will involve bombing Tokyo and then landing in China. However, the Japanese discover them early, forcing the raiders to launch from a longer distance then planned. After a successful bombing against Tokyo, the raiders crash land on Japanese-occupied territory in China on a rice paddy. The Japanese Army have the members of Rafe's plane pinned down and when they are about to get shot, Danny's plane flies over and shoots the Japanese patrol surrounding Rafe and his crew before crashing.
Rafe runs to Danny's side and attempts to pull a sharp piece of metal from Danny's neck, but they are once again attacked by Japanese patrols. Rafe is hit over the head by a gun butt and Danny gets tied to an ox yoke. Rafe picks up a pistol and shoots the Japanese holding Danny, but runs out of ammunition. He is about to get shot when Danny hits the Japanese with the ox yoke. The remaining patrols shoot Danny, and the other pilots Red (Ewen Bremner) and Gooz (Michael Shannon) kill off the remaining Japanese patrolmen. Holding a dying Danny in his arms, Rafe tells Danny that he can't die because he is going to be a father, but Danny replies by saying his last words, "No, you are", before dying in Rafe's arms. The remaining pilots are rescued by the Chinese, and when returning home, a pregnant Evelyn sees Rafe getting off the plane, and hopes that Danny is alive until she sees Rafe carrying his coffin. She walks to the coffin, grasps Danny's coat for a second, then, crying, she embraces Rafe.
Afterward, both Evelyn and Rafe are awarded medals. Evelyn's voice narrates that Dorie Miller (Cuba Gooding, Jr.) was the first African American to be awarded the Navy Cross, but that he would not be the last. Rafe is awarded his medal by President Roosevelt, and he and Evelyn are discharged from the army. A few years later after the war ends, Rafe and Evelyn, now married, are visiting Danny's grave with their son, also named Danny, after his biological father. Rafe asks baby Danny if he would like to go flying, and the two fly off in the sunset in an old biplane.