At the time, we were surprised to see rebel forces there, and I suppose they were surprised to see us. We assumed they had intercepted our communications or something, and I imagine they thought the same. I doubt anyone knew we were all being manipulated by a droid. A criminal droid.
—An Imperial captain reflecting on the battle
The Battle of the Terax Nebula occurred a few years before the Battle of Yavin between Imperial and rebel forces. It was all part of an operation planned by Unit 8311, leader of the powerful crime organization called the Steel Legion.
The prelude of the battle came up when Legion ships scouting in a sector discovered an old abandoned Republic Mandator-class star dreadnaught floating in space, having been abandoned in the Clone Wars. 8311 quickly had the massive vessel transported to a secret Legion shipyard where it was repaired and most systems automated, as the Legion could not afford to have it fully crewed. With that, the Legion used the powerful vessel to eliminate many of its enemies, including pirates who were defying the Legion, and wrecked havoc on many trade routes, using it to destroy protectors of merchant fleets.
Eventually, however, 8311 realized that the ship presented too big a target and was easily traceable, and soon damage that the ship had suffered whilst floating through space for over a decade began to show itself. Realizing that it would not be practical for the Legion to keep the ship, 8311 made a deal with Imperial officials, offering them the vessel to sell for a large price. The Imperials accepted, and agreed to take possession of the ship near the Terax Nebula. Meanwhile, 8311 approached some rebels and sold them the vessel as well, whilst arranging for the rebels to pick the ship up at the same time and place as the Imperials. Both sides paid in advance.
The star dreadnaught was positioned in the fringes of the nebula as planned and the Legion crews quickly abandoned it, and were picked up by a Legion fleet hiding in the gases of the nebula. Soon, an Imperial flotilla arrived, and literally seconds later a rebel group of ships also turned up. Both sides quickly assumed that the other had learned of the ship and the deal and began engaging each other. The Imperial fleet outnumbered and outclassed the rebels, but 8311 had arranged for something to even the odds: invisible antimatter bombs. Several Imperial vessels were damaged or destroyed by the mines, allowing the rebels to continue with the attack.
Meanwhile, Imperial and rebel boarding crews attempted to board the star dreadnaught, and fighting took place in its decks. The Empire managed to take control of the ship's automated systems, and took control of most of the ships.
Outside in the space battle, Imperial TIE bombers were disabling the rebel hyperdrives, prompting a few rebel ships to perform kamikaze suicide attacks on the Imperial ships rather than be captured. The ingenious rebels also used the nebula to their advantage, luring many wings of Imperial TIE fighters into ion storms within the turbulent cloud, destroying them. However, the Empire was starting to send for reinforcements, and it was clear that the battle was going against the rebels.
With the destruction of the lead rebel ship, the remnants of the rebel taskforce retreated, whilst the fighters which could not escape rammed Imperial ships, causing further damage. The battle was officially won for the Empire.
The Empire took possession of the star dreadnaught and it hyperspaced away with the Imperial fleet, but a few star destroyers which had their engines crippled stayed behind for repairs. Suddenly, the Legion fleet, which consisted mainly of Venator-class star destroyers, emerged from its hiding place. The helpless Imperial vessels were overwhelmed and their crews defeated.
The Legion purged the damaged Imperial vessels of all useful components, and did the same with the various wrecks in the area. Once every last component of value was stripped from the scene, the Legion dismantled the wrecks and took their pieces with them as they escaped. A few days later, the components were put on for sale on the black market at high prices, as well as some of the wrecks, which had been melted down for resources. The Legion made a vast amount of money from both the sale of the star dreadnaught and the black market sales.
Neither the Empire nor the rebels suspected they had been duped until long after. When the Empire lost contact with the ships it had left behind, it simply assumed that the nebula had consumed them. Only some Imperials who noticed a sudden surge of imperial and rebel components for sale on the black market, as well as 8311's and the Legion's credit totals skyrocket, felt suspicious in any way.