Under the leadership of Jedi General Mace Windu, the 187th Legion was an elite clone trooper legion within the Grand Army of the Republic. This legion fought in the Clone Wars against the Confederacy of Independent Systems, representing the Galactic Republic. Later, they were integrated into the Imperial Army of the Galactic Empire, the Republic's successor, where they enforced Imperial law. Notably, another unit commanded by Windu during the Clone Wars shared the legion's designation: the 187th Battalion.

The clone trooper legion known as the 187th, an elite division of the Grand Army of the Republic, operated under the command of Jedi High Council Master Mace Windu. Later, it was reorganized as part of the Imperial Army. This unit shared its designation with another Windu-led unit, the 187th Battalion. The troopers of the 187th customized their Phase II clone trooper armor, which was white, with light blue and purple accents, echoing the color of their Jedi General's unique purple lightsaber blade.
The helmets of the 187th were distinguished by purple on the chin and the central helmet fin, along with light blue vertical stripes across the top of the T-shaped visor and on the cheeks. Some helmet variations replaced the light blue with a light gray. Purple accents adorned the shoulder armor plates, chest, knees, and boots, while blue stripes marked the arm and leg armor. The lower part of the leg armor was completely painted purple. Like other units in the Republic Army, the 187th clone troopers used utility belts around their hips, also painted in purple. They were armed with the DC-15A blaster carbine and the DC-15A blaster rifle. Some members also wore pauldrons with ammunition pouches.

During the Clone Wars, the elite 187th Legion, under the command of Jedi General Mace Windu, fought for the Galactic Republic against the Confederacy of Independent Systems. Around 20 BBY, following the Battle of Mon Cala, the 187th was equipped with Phase II clone trooper armor. Despite the Jedi Order's principles, the coloration and design of Windu's troops' helmets instilled fear in their adversaries. After Windu's death and the destruction of the Jedi Order through Order 66, a secret Executive Order Code that branded the Jedi as traitors, Supreme Chancellor Sheev Palpatine transformed the Republic into the Galactic Empire. Consequently, the Republic Military evolved into the Imperial Military.
Clone troopers were forced to obey Palpatine, secretly the Dark Lord of the Sith Darth Sidious, and execute Order 66 due to their behavioral modification biochips. The 187th continued to serve as a legion within the Imperial Army, tasked with defending a regime that openly hunted the Jedi. The 187th served in a desert environment at some point.

The 187th Legion was officially integrated into the Star Wars canon with the unveiling of the "Republic Fighter Tank" set from LEGO Star Wars, showcased on This Week! in Star Wars by Kristin Baver on March 31, 2022. The legion also made an appearance in the non-canon animated short Happy Celebration 45th Anniversary A New Hope, a LEGO creation celebrating 45 years of Star Wars: Episode IV A New Hope and Celebration Anaheim 2022. A helmet of the 187th Legion was included as one of eight collectible pins in the Mystery Helmets Collection at Celebration Anaheim. The 187th Legion initially appeared in Star Wars Legends in the 2006 Target-exclusive Hasbro set, "Mace Windu's Attack Battalion."
The "Republic Fighter Tank" set's box art depicts Mace Windu and two 187th Legion clone troopers, alongside an 187th Clone Commander, engaging two B1-series battle droids on a mountainous desert terrain aboard a TX-130 Saber-class fighter tank. The clone figures in this set featured markings that included a small, dark pauldron on their right shoulder. Their commander wore clone paratrooper armor with purple markings, a similar pauldron, and a beige kama. The canonical status of the legion was cemented with the 2023 Hasbro figure set, "Mace Windu & 187th Legion Clone Trooper," for Star Wars: The Black Series. The Hasbro Pulse listing was titled "Mace Windu & Clone Trooper," but the complete name was on the release box.
In "The Bad Batch," the first episode of the seventh and final season of Star Wars: The Clone Wars, which premiered on February 21, 2020, a clone unit led by Mace Windu, the 187th Battalion, was featured. An unfinished version of the episode was previously shown at Celebration Anaheim on April 17, 2015. Leland Chee of the Lucasfilm Story Group stated that the decision to omit the purple color scheme of the 187th Legion was made during the first season of the series, which began in 2008. The unit was officially named the "187th Battalion" during the Hasbro Pulse livestream for May the Fourth, 2022, as a Star Wars: The Black Series set.

Clone Commander Ponds served under Mace Windu in "Liberty on Ryloth," the penultimate episode of the first season, which aired on March 13, 2009. Ponds had customized his armor with colors similar to those of Mace Windu's unit in the seventh season. Sources such as Star Wars: On the Front Lines and Star Wars Helmet Collection 76 indicate that Commander Ponds led Lightning Squadron within the 91st Mobile Reconnaissance Corps. Chee clarified that the intention was to maintain them as separate units with distinct color schemes. The reveal of the Black Series Hasbro figure inadvertently confused the 187th Legion and 187th Battalion.