An opening crawl reveals that the galaxy is in a state of civil war. The Rebel Alliance has stolen plans to the Galactic Empire's Death Star: a space station capable of annihilating a planet. Rebel leader Princess Leia Organa has possession of the plans, but her ship is captured by Imperial forces under the command of Darth Vader. Before she is captured, Leia hides the plans in a droid named R2-D2, along with a holographic recording. The small droid escapes to the surface of the desert planet Tatooine with fellow droid C-3PO. The two droids are quickly captured by Jawa traders, who sell the pair to moisture farmer Owen Lars and his nephew, Luke Skywalker. While Luke is cleaning R2, he accidentally triggers part of Leia's holographic message, in which she requests help from General Obi-Wan Kenobi. The only "Kenobi" Luke knows of is an old hermit named Ben Kenobi who lives in the nearby hills; Owen, however, dismisses any connection, suggesting that Obi-Wan is dead.

During dinner, R2 escapes to seek Obi-Wan. Luke and 3PO go out after him and are met by Ben Kenobi, who reveals himself to be Obi-Wan and takes Luke and the droids back to his hut. He tells Luke of his days as a Jedi Knight and explains to Luke about a mysterious energy field called the Force. He also tells Luke about his association with Luke's father, also a Jedi, who he says was betrayed and murdered by Darth Vader, Kenobi's former pupil who turned to evil. Obi-Wan then views Leia's message, in which she begs him to take R2 and the Death Star plans to her home planet of Alderaan, where her father will be able to retrieve and analyze them. Obi-Wan asks Luke to accompany him to Alderaan and to learn the ways of the Force. After initially refusing, Luke discovers that his home has been destroyed and his aunt and uncle killed by Imperial stormtroopers in search of the droids. Luke agrees to go with Kenobi to Alderaan, and the two hire smuggler Han Solo and his Wookiee co-pilot Chewbacca to transport them on their ship, the Millennium Falcon.

Meanwhile, Leia has been imprisoned on the Death Star and has resisted interrogation. Grand Moff Wilhuff Tarkin, the Death Star's commanding officer, tries to coax information out of her by threatening to destroy Alderaan and proceeds to do so even after she appears to cooperate as a means of demonstrating the power of the Empire's new weapon. The planet's destruction is felt by Obi-Wan aboard the Millennium Falcon while he is instructing Luke about the Force. When the Falcon arrives at the Alderaan's coordinates, they find themselves in a field of rubble. They follow a TIE fighter towards the Death Star, which they mistake for a moon, and are captured by the station's tractor beam and brought into its hangar bay. The group takes refuge in a command room on the station while Obi-Wan goes off by himself to disable the tractor beam. While they are waiting, R2-D2 discovers in the station's computer that Princess Leia is onboard and is scheduled for termination. Han, Luke and Chewbacca stage a rescue and free the princess. Making their way back to the Millennium Falcon, their path is cleared by the spectacle of a lightsaber duel between Darth Vader and his former master, Obi-Wan. Obi-Wan allows himself to be struck down as the others race onto the ship and escape.

The Falcon journeys to the rebel base at Yavin IV where the Death Star plans are analyzed by the rebels and a potential weakness is found. The weakness will require the use of one-man fighters to slip past the Death Star's formidable defenses and attack a vulnerable exhaust port. Luke joins the assault team while Han collects his reward for the rescue and leaves, despite Luke's request for him to stay. The attack proceeds when the Death Star arrives in the system, having followed the Falcon to the rebel base. The rebel fighters suffer heavy losses and after several failed attack runs, Luke remains piloting one of the few remaining ships. Darth Vader appears with his own group of fighters and begins attacking the rebel ships. Luke begins his attack run with Vader in pursuit, as the Death Star approaches firing range of Yavin IV. During his run, Luke hears Obi-Wan's voice telling him to use the Force, and he turns off his targeting computer. As Vader is about to fire at Luke's ship, the Millennium Falcon appears and attacks Vader and his wingmen, sending Vader's ship careening off into space. Luke fires a successful shot which destroys the Death Star seconds before it fires on the rebel base. Later, at a grand ceremony, Princess Leia awards medals to Luke and Han for their heroism in the battle.