First appearing in The Phantom Menace as one of the primary antagonists, Viceroy Gunray led the Trade Federation in their blockade of the planet Naboo. Officially, the Federation's blockade of trade routes was due to dissatisfaction with taxation of the Outer Rim's commerce lanes, but in actuality the occupation was part of a grander scheme by the Sith to take control of the Republic via diplomatic espionage. Gunray's occupation of Naboo failed largely due to the efforts of the Jedi Knights Qui-Gon Jinn and Obi-Wan Kenobi, as well as former slave child Anakin Skywalker. Although Gunray stood multiple trials in the Republic Supreme Court, he retained his position as Viceroy of the Trade Federation and continued to plot and scheme against the Republic along with the Sith lord Darth Sidious.
By 22 BBY (Attack Of The Clones), Nute Gunray had signed a treaty with Count Dooku and pledged the Trade Federation's battle droid army to the growing Separatist movement. He also held a grudge against Padme Amidala, the former Naboo queen who had defeated his occupation of Naboo ten years previously, and had made plans for her assassination. He found himself being humiliated once again by the senator and by the Jedi as the Battle of Geonosis took place. Since Geonosis, Gunray served as one of the most prominent council members of the Confederacy of Independent Systems, providing the majority of the CIS's droid forces during the Clone Wars. Oddly enough, although Gunray was a cowardly man like most Neimoidians, he was not afraid to talk down to General Grievous who led the droid army.
In Revenge Of The Sith, Gunray and the rest of the Separatist Council are relocated to the volcanic world of Mustafar following the death of Count Dooku. As Darth Sidious established himself as Emperor of the newly-founded Galactic Empire, he congratulated Gunray for his services and told him that his new apprentice Darth Vader was on his way to "take care" of the council. When Vader arrived, Gunray and the other Separatist leaders were shocked to find that Vader was in fact Anakin Skywalker. After entering the Separatist base, Vader sealed the compound off and systematically slaughtered every last Council member and all of their guards and staff. Gunray was left till last and he pathetically begged for mercy before Vader cut him down too.