Around the time of 19 BBY, a conflict unfolded on the planet Agamar. This clash, a part of the Clone Wars, pitted the Galactic Republic against the Separatist Alliance. Before this engagement, General Kalani, an ST-series military strategic analysis and tactics droid, received instructions from Count Dooku, the Separatist leader. Kalani was to await further orders on Agamar, accompanied by the surviving forces from the Separatist defeat on Onderon in 20 BBY. However, as Kalani's DH-Omni Support Vessel approached Agamar, it was ambushed by Republic forces, leading to a crash landing on the planet's surface.
Shortly after these events, following the implementation of Order 66, which compelled the Republic's Grand Army to eliminate the Jedi Order, Darth Vader, the Sith apprentice, issued a command to deactivate the Separatist Droid Army. Suspecting a Republic ploy, Kalani disregarded the order, keeping his battle droids active. These droids remained on Agamar for seventeen years, until their discovery during the Galactic Empire's reign.
During the Clone Wars, which saw the Galactic Republic in conflict with the Confederacy of Independent Systems, the Separatist Droid Army experienced several setbacks on the planet Onderon in 20 BBY, during their civil war with a group of rebels. In response, Count Dooku, the Separatist Head of State, dispatched General Kalani, an ST-series military strategic analysis and tactics droid, to Onderon with the aim of suppressing the resistance. However, following further defeats, Dooku instructed Kalani to withdraw the remaining forces from Onderon and relocate them to Agamar, where they would await new instructions.

At approximately 19 BBY, while awaiting further commands, Republic forces launched an attack on Kalani's DH-Omni Support Vessel above Agamar. Consequently, during the confrontation, the supply ship crashed onto the planet, leaving the droid general and his battle droids stranded on Agamar as the Clone Wars drew to a close.
Following the Agamar engagements, the Jedi Order was systematically eradicated across the galaxy. This purge occurred as clone troopers of the Grand Army of the Republic received directives from Supreme Chancellor Sheev Palpatine—secretly the Sith Lord Darth Sidious—to execute their Jedi Generals in accordance with Order 66. After the beginning of the Jedi's purge from the galaxy, Darth Vader, the Sith apprentice, issued an immediate deactivation command to the Trade Federation, which ordered the shut-down of all battle droid units within the Separatist Droid Army, after his slaughtering of the Executive Separatist Council on the planet Mustafar. However, Kalani, suspecting a Republic deception, ignored the order and chose not to deactivate himself or his droid garrison on Agamar.
The battle of Agamar was first referenced within the new Star Wars canon in "The Last Battle," the sixth installment of the Star Wars Rebels television series' third season, which was broadcast on October 22, 2016. Within the Star Wars Legends continuity, the Mirgoshir campaign was initially indirectly mentioned in the Star Wars: The Clone Wars, a video game released in 2002 by LucasArts. Its identification occurred later in the StarWars.com Databank entry for the Unstable Terrain Artillery Transport.