The film begins with voice-over narration on a black screen, as Anthony Swofford (Jake Gyllenhaal), waxes philosophically about a soldier whose hands forever remember the grip of a rifle, whatever else they do in life. Swofford is then shown in a U.S. Marine Corps boot camp, being brutalized by a drill instructor in a scene reminiscent of Full Metal Jacket. After finishing boot, "Swoff" is dispatched to Camp Pendleton in 1989, where he is subjected to a cruel joke played on him by the senior Marines. This involves branding onto him the initials of the United States Marine Corps, USMC, with a hot iron. This is a popular tattoo amongst Marines. He faints upon sight of the iron. After regaining consciousness, he realizes to his relief that the senior Marines had switched the hot iron with another room temperature iron. He is greeted coolly by Troy (Peter Sarsgaard), who says to him, "Welcome to the Suck."
Swofford comes across the charismatic Staff Sergeant Sykes (Jamie Foxx), a Marine "lifer" who invites Swofford to his Scout Sniper (formally the Surveillance and Target Acquisition) course. After arduous training sessions that claim the life of one recruit, he becomes a sniper and is paired with Troy as his spotter. Shortly after, Kuwait is invaded by Iraq and Swofford's unit is dispatched to the Persian Gulf as a part of Operation Desert Shield. Although the Marines are very eager to see some combat action, they are forced to hydrate, wait, patrol the nearby area and orient themselves to the arid environment. When some field reporters appear, Sykes forces his unit to demonstrate their NBC suits in a game of American football, even under the 112 degree heat. While the cameras roll, the game develops into a rowdy dogpile, with some Marines playfully miming sex acts. Sykes, embarrassed by his platoon's rude manners and poor discipline, removes the cameras and crew from the area; the Marines are later punished by being forced to build and take down a massive pyramid of sandbags in a rainy night.
During the long wait, some of the Marines fear their wives and girlfriends at home will be unfaithful. A public board displays the photos of women who have ended their relationships with members of the unit. Swofford himself begins to suspect that his girlfriend is, or will soon be, unfaithful. The most public and humiliating of these befalls Dettman (Marty Papazian), who discovers an innocent looking copy of The Deer Hunter on VHS sent from his wife, which the men are all seated to watch, is actually a homemade pornographic movie tape of her having sex with their neighbor, apparently made as revenge for Dettman's own promiscuity.
During an impromptu Christmas party, Fergus (Brian Geraghty), a member of Swofford's unit, accidentally sets fire to a tent and a crate of flares. Swofford gets the blame because he was supposed to be on watch, but had Fergus sit in for him. As a consequence, Swofford is demoted from Lance Corporal (E-3) to Private (E-1) and is forced to undertake the degrading task of burning excrement. The punishments, the heat and the boredom, combined with suspicions of his girlfriend's infidelity and feelings of isolation, temporarily drive Swofford to the point of mental breakdown. He threatens and nearly shoots fellow Marine Fergus.
After the long stand in the desert, Operation Desert Storm, the coalition force's ground campaign, begins, and the Marines are dispatched to the Saudi-Kuwaiti border. Briefly before the action begins, Swofford learns from Sykes that Troy concealed his criminal record when enlisting and will be discharged after the end of hostilities. Following an accidental air attack from friendly forces, the Marines advance through the desert, facing no enemies on the ground. Casualties are taken when friendly fire from an A-10 close air support aircraft hits U.S. vehicles. The troops march through the Highway of Death, strewn with burnt vehicles and remains of charred bodies, a product of the bombing campaign. Later, the Marines encounter burning oil wells, lit by the retreating Iraqis, and they attempt to dig sleeping holes as a rain of crude oil falls from the sky. Before they can finish them Sykes orders the squad to move to where the wind prevents the oil from raining on them. While digging new sleeping holes, Swoff discovers Fowler has defiled an Iraqi corpse which drives Swoff to the point of wanting to fight him. However he merely takes the body and buries it somewhere else.
Swofford and Troy are finally given a combat mission. Their order is to shoot two Iraqi officers, supposedly located in a control tower at a battle-damaged airport. The two take up positions in a deserted building, but moments after Swofford pinpoints one of the officers in his sights, another team of Marines appears and calls in an air strike. Troy, desperate to make a kill, pleads with the officer in charge (Dennis Haysbert) to let them take the shot. When his pleas are denied, Troy breaks down in a fit of despair and weeps. Moments later the airport is bombed by U.S. warplanes. Swofford and Troy linger at the site in a daze, losing track of time and missing their pick-up. With night falling, they try to navigate the desert but get lost. Distant cries in the darkness frighten them, and as they begin to sense that the sounds are coming from beyond a ridge, they ready their weapons and prepare to descend. They see an encampment in the distance, but on closer look they recognize it as their base camp, and the sounds as Marine voices. The war is over, they learn, and scores of Marines celebrate this amidst a bonfire. In a climactic scene Swofford tells Troy he never fired his rifle, getting a response of "You can do it now". He then fires a round in the air from his sniper rifle and the other Marines, who also never had a chance to fire their weapons, follow suit, emptying magazines into the night sky.
On returning home the troops parade through the towns in a jovial celebration of victory. The mood is disturbed when a disheveled Vietnam veteran, possibly suffering from the memories of the conflict, jumps into their bus, and congratulates them all. Soon after their return home, Swofford and his comrades are discharged and go on with their separate lives. Swofford returns home to his girlfriend, but discovers her with a new boyfriend. Fowler (Evan Jones) is seen to be spending time with a girl at a bar, Kruger (Lucas Black) is seen in a corporate boardroom, Escobar (Laz Alonso) as a supermarket employee, Cortez (Jacob Vargas) as a father of three kids, and Sykes continuing his service as a Master Sergeant in Operation Iraqi Freedom. An unspecified amount of time later, Swofford learns of Troy's death during a surprise visit from Fergus. He attends the funeral, meets some of his old friends, and afterwards he reminisces about the effects of the war.