The Galactic Empire is one of the main factions in the fictional universe of Star Wars. It is a galaxy-spanning regime established by the series' lead villain, Palpatine, to replace the Galactic Republic in Star Wars Episode III: Revenge of the Sith. The Galactic Empire is introduced in A New Hope. The Empire also appears in The Empire Strikes Back, and in Return of the Jedi. The Empire's origins are explained in Star Wars Episode II: Attack of the Clones and Star Wars Episode III: Revenge of the Sith, where it replaces the Galactic Republic in the midst of a crisis orchestrated by Palpatine, then the Republic's Supreme Chancellor. In a scene towards the end of the film, Palpatine appoints himself Emperor in the presence of the Galactic Senate, afterwards the Imperial Senate. By the time of A New Hope, the Empire has transformed into a merciless totalitarian regime, still struggling with the Rebel Alliance.