The theatrical version of the film begins in 1928, where Professor Langford discovers a massive stone ring in the sands of Giza, Egypt. In the present day, Langford's daughter Catherine offers Egyptologist Daniel Jackson, down on his luck linguistics professor, the chance to translate ancient Egyptian hieroglyphs that may prove his controversial theory regarding the Pyramid of Khufu. Jackson accepts and is taken to a US Air Force installation inside Creek Mountain, Colorado. Jackson translates the hieroglyphs on the stone ring's coverstones, which read: "A million years into the sky is Ra. Sealed and buried for all time, his Stargate." Formerly retired Air Force Special Forces Colonel Jack O'Neil arrives to take command of the project and declares all information regarding it as now classified.
Jackson notices that the symbols are star constellations that are coordinates for a location within space. The sequence is entered into the stargate, creating a wormhole to a location in another galaxy. After O'Neil leads a team through the stargate, they find themselves inside a pyramid in the middle of vast sand dunes. Jackson reveals they cannot dial home because the Stargate coordinates to go back to Earth are missing. Some team members stay at the pyramid while Jackson, O'Neil, and others go out and discover a mining village inhabited by humans who assume them to be gods sent by Ra.
Jackson realizes that the people speak a dialect of Ancient Egyptian and begins communicating with them. The team develops friendships with the people; O'Neil with Skaara, and Jackson begins a budding romance with Sha'uri, a daughter of the leader. Jackson learns from hieroglyphs in the catacombs how the Egyptian god Ra was actually an alien life form who enslaved humans with his advanced technology. While these humans eventually rebelled and buried the Stargate, some had been taken to the other planet through the Stargate and used to mine the quartzite-like mineral on which all of Ra's technology is based. Fearing another rebellion on this planet, Ra outlawed reading and writing. At this point, the team from Earth discovers the coverstone to get back to Earth, but the seventh symbol is eroded away.
O'Neil orders the team to return to the pyramid. A short time later, a huge spacecraft lands on top of the pyramid. All team members in the pyramid are either killed or taken into the pyramidal craft. O'Neil and Jackson are escorted to the throne room, where they meet Ra. Despite wearing fearsome armor, Ra's guards and servants are human. Ra reveals his intention to send the atomic bomb brought by O'Neil, which was to be used to destroy the Stargate to prevent invasion by any threat, back to Earth; it is now enhanced with his quartzite-like material to produce cataclysmic results. O'Neil attempts to disarm the guards and kill Ra, but relents when Ra uses his children courtiers as human shields. Jackson is killed during the altercation. O'Neil is thrown into a dungeon with the captured team members, while Jackson is regenerated in a sarcophagus-like device. Ra states that he will kill Jackson and everyone who has seen him unless Jackson kills the rest of the team to show the villagers that Ra is their one true god.
However, once Ra has the local people gathered before the pyramid craft, several young villagers signal to Jackson that they have recovered the team's weapons. Jackson then shoots at Ra while the kids create a distraction. O'Neil, Jackson, and the rest of the team flee Ra's ship and take shelter in a cave with the boys. The next morning, when Skaara draws a picture of the people's victory against Ra, Jackson realizes that part of this drawing depicts the seventh symbol needed to reactivate the Stargate: three moons over a pyramid.
O'Neil convinces the locals that their "gods" are mere mortals and, with their help, O'Neil, Jackson, and the remaining members of the team make it back to the Stargate hoping to deactivate the bomb. When the locals begin an open rebellion against Ra's troops, Ra decides to retreat and prepares his ship for takeoff. Sha'uri is killed in the battle, but Jackson resurrects her in Ra's sarcophagus and manages to escape when O'Neill activates the ship's ring transporter (teleportation device). Unable to deactivate the bomb, O'Neil and Jackson transport the bomb to Ra's ship in orbit via the rings where it explodes, killing Ra. The team is able to return to Earth through the Stargate, though Jackson decides to remain on the planet.