In 1923 Tennessee, two young boys, Rafe McCawley (Jesse James) and Danny Walker (Reiley McClendon), play 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. He calls Rafe a "stupid boy" and beats Danny. In an effort to protect Danny, Rafe hits Danny's father with an old propeller and calls him a "dirty German". Danny's father 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.
Eighteen years later, in January 1941, Danny (Josh Hartnett) and Rafe (Ben Affleck) are both first lieutenants under the command of Major Jimmy Doolittle (Alec Baldwin). Doolittle informs Rafe that he has been accepted into the Eagle Squadron (a RAF outfit for American pilots during the Battle of Britain). Rafe immediately accepts the position. Rafe lies to Danny, though, saying that he was assigned by Doolittle and had no say in the matter.
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 met Rafe four weeks earlier after he passed his medical exam despite his dyslexia. That night, Rafe and Evelyn enjoy an evening of dancing at a nightclub and later a jaunt in New York harbor in a borrowed police boat. 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 is pleased to see that she comes anyway as he leaves the following morning.
In the meantime, Danny, Evelyn and their fellow pilots and nurses are transferred to Pearl Harbor, where there is little action; 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. It is then that Danny learns from Evelyn that Rafe volunteered for the assignment.
Three months later, Evelyn and Danny realize they are developing feelings for each other. Danny takes Evelyn for a sunset flight over the harbor and begins a relationship with her.
On the night of December 6, Evelyn is shocked to discover Rafe, alive and well, standing outside her door. He explains that he survived his aircraft crash and was rescued by a French fishing boat, and has been 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 leaves feeling betrayed. He goes to the Hula bar where he is welcomed back by his overjoyed fellow pilots. Danny finds Rafe in the bar with the intention of making things right but a drunken Rafe will have none of it. The two get into a fight. When the police arrive, Danny and Rafe 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 pilots drive away in search of a still standing airfield, while Evelyn and the other nurses rush for the hospital. The nurses 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 Zeros. 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 fellow nurses and pilots. Later, Danny and Rafe are assigned to travel stateside under Major Doolittle for a secret mission. Before they leave, Evelyn reveals to Rafe that she is pregnant with Danny's child and that she will remain with Danny, though she claims she will always love Rafe just as much.
Upon their arrival in California, Danny and Rafe are both promoted to captain and awarded the silver star. Doolittle asks them to volunteer for a top secret mission, which they both immediately accept although the risks are high. While sitting at a bonfire on a beach, Rafe attempts to dissuade Danny from going, but Danny decides to go anyway, thinking that Rafe is just trying to protect him. During the next three months, Rafe, Danny and other pilots train with specially modified B-25 Mitchell bombers, learning how to launch them with a limited runway. In April, the raiders are sent towards Japan on board the 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 than planned. After a successful bombing run against Tokyo, the raiders crash-land on Japanese-occupied territory in China in a rice paddy. The Japanese Army pin down Rafe's plane, but Danny's crew flies over and shoots the Japanese patrol 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. Danny is shot during the attack while 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, to which the dying Danny replies that Rafe will have to be the father. The remaining pilots are rescued by the Chinese. Upon his return home, a visibly pregnant Evelyn sees Rafe getting off the aircraft, carrying Danny's coffin.
Afterward, both Evelyn and Rafe are awarded medals. 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, visit Danny's grave with Danny's and Evelyn's son, also named Danny. Rafe asks baby Danny if he would like to go flying, and the two fly off into the sunset in an old biplane.