The HK-51 series assassin droid represented a specific model within the Hunter-Killer series of assassin droids. These droids were produced by the Czerka Corporation in the time leading up to the conclusion of the Great Galactic War.
Despite the fact that the Galactic Republic had forbidden HK-series assassin droids, the Czerka Corporation secretly began the development and construction of multiple HK-51 units on Nar Shaddaa as the Great Galactic War drew to a close. The reconstituted Sith Empire had placed this order, with intentions to deploy the new droids approximately ten years into the subsequent Cold War.

At some point following 3668 BBY, the Sith warship known as the Fatality, which was transporting the droid consignment, was seized by a Dread Masters' apprentice. This apprentice attempted to land on and deploy the droids upon the planet Belsavis in an effort to liberate his captured masters. Republic forces stationed on the planet engaged the vessel, resulting in its crash and submersion within the frozen waters of Section X. This event led not only to the loss of the only known shipment of HK-51 units, but also to the deletion of all HK-51 design schematics from Czerka's network by slicers of an unknown allegiance. The sole remaining copy of the schematics was located on board the Czerka research vessel Theoretika, which had lost contact with Czerka's network, thus preventing it from being targeted in the slicer attack. Until approximately 3639 BBY, when the escaped Dread Masters finally pinpointed the location of their stolen cargo, the Fatality and its deadly contents remained concealed.
Upon its recovery, the Dread Masters promptly secured the area. They successfully defended against substantial assaults from both Republic and Imperial forces, resulting in significant casualties on both sides. The Dread Masters maintained control of the wreckage and attempted to gain access to the cargo hold containing the HK-51s, until a significant individual battled through the Dread Masters' forces and entered the cargo hold, only to be disappointed to find that almost all of the HK-51s on board were irreparable due to the crash and prolonged exposure to the icy environment. Only one HK-51 could be salvaged, but it required replacement of several crucial parts. Unfortunately, because the HK-51 schematics had been lost, even Czerka lacked the necessary components. Undeterred, the individual departed to locate the wreck of the Theoretika and the last existing copy of the missing schematics.
Upon arriving at the Theoretika and understanding what had transpired on the wreck, the individual overcame the monstrous experiments that were aboard, located, and downloaded the HK-51 schematics. After leaving the wreck, they began the search for the parts that the HK-51 needed. This search took them to the Outlaw's Den on Tatooine, where they encountered a Jawa who sold them a wrapped HK transistor, along with a Burba Seismic Excavator/Scanner that would aid in finding the remaining parts. The individual searched in the Sinking City on Taris and the Glacial Fissure on Hoth, and also the Dark Temple on Dromund Kaas and the Jedi Temple on Coruscant. The loyalty chip was recovered from the legendary Force user Revan upon the individual's encountering the ancient Jedi, while the Weapons Protocol software was discovered within the memory banks of the notorious assassin droid HK-47, who had been located, repaired, and upgraded by the newly proclaimed Emperor Malgus. Returning to Section X, the individual fought through the Dread Host forces and reentered the Fatality. With assistance from a droid engineer assigned to them, they repaired and reactivated the only surviving HK-51. Upon being activated, the droid brandished his weapon and startled the engineer before greeting his new master with cheerfulness.

While in service to his new master, HK-51 began to notice a decline in his combat and assassination effectiveness. Analysis of this trend revealed that, if it continued, the droid would eventually become non-functional. The underlying cause was a failsafe subroutine deeply embedded within HK-51's programming. This failsafe was designed to trigger a complete shutdown unless HK-51 successfully assassinated at least one individual from a pre-programmed kill list. However, eliminating a target would only temporarily slow down the degradation of his protocols. His master sent HK-51 to assassinate one of the targets, a mission that HK-51 carried out successfully. Following the mission, he reported that his protocols were functioning at the same level of efficiency as when he was first manufactured. Developing a sense of admiration, bordering on idolization, for his master, HK-51 grew concerned that he might one day be reprogrammed to turn against the master he respected. In search of a solution, HK-51 discovered a loyalty subroutine that would permanently fix his allegiance to his master and anyone else his master designated. His master agreed to activate the subroutine, which overjoyed HK-51, who then congratulated his master and suggested celebrating by eliminating a large number of enemies.
Even though his master vanished during the Eternal Empire conquest in 3636 BBY, HK-51 was reunited with them in 3631 BBY, after his master was rescued from captivity on Zakuul and assumed the role of the Commander of the Alliance that opposed the Eternal Empire. HK-51 was reunited with his master at the Alliance base on Odessen. There, during a party at the Alliance cantina, the droid was approached by Tora, who mistakenly identified him as HK-55, another HK-series assassin droid she had recently encountered on the Asylum.

HK-51 series droids were engineered to be exceptionally efficient assassins, finding considerable satisfaction and pride in their designated function. They were programmed to exhibit politeness, cheerfulness, and friendliness towards their masters and allies. Their creators believed that earlier models were excessively unsettling in their brutality. The HK-51 series did not appear to express the same level of hatred or revulsion towards organic beings or other droids that was characteristic of previous HK models. HK-51 series also displayed a distaste for political intrigue and factional disputes, although they would participate in such activities if instructed to do so by their masters. Outwardly, HK-51 series droids resembled nothing more than an antiquated Systech Corporation protocol droid. This was typical for most HK-series droids, contributing to their unparalleled lethality.
The HK-51 series featured several improvements and upgrades compared to its predecessor models. In addition to being more heavily armored and accurate, HK-51 series droids were significantly more agile and maneuverable, capable of executing faster and more fluid movements, almost mimicking those of organic humanoids, and performing leaps and combat rolls. HK-51 series droids also had integrated weapons and equipment: wrist-mounted micro-missile launchers and railguns, concealed smoke grenades, a stealth field generator, and the ability to self-repair in the event of critical damage. As a last resort, HK-51 series droids were equipped with a powerful explosive device that they could detonate in a kamikaze attack to complete their mission.

In the unfinished portion of Star Wars: Knights of the Old Republic II: The Sith Lords, HK-47 was to confront G0-T0 on Malachor V, with a group of HK-51 droids appearing to assist him in defeating G0-T0, provided that HK-47 had programmed them to offer aid while in the HK Manufacturing Plant. HK-47 also had the option to destroy them, which would result in his defeat by G0-T0. The HK Manufacturing Plant and all related content were removed from the released version of the game and are only available through fan-created modifications.
HK-51 droids later appeared in Star Wars: The Old Republic as companion characters accessible to all classes. Unlike other companions, acquiring HK-51 necessitates completing a specific questline that begins in the Section X area of Belsavis and culminates in the discovery of the crashed Imperial battlecruiser Fatality, which was transporting a full complement of damaged HK-51s, with only one proving salvageable. To claim HK-51, the player must explore the abandoned Czerka Corporation cruiser Theoretika located in the Unknown Regions and retrieve a set of HK schematics. Subsequently, they must gather specific HK parts from Coruscant, Dromund Kaas, Taris, Hoth, and Tatooine, as well as the False Emperor and either the Maelstrom Prison (Republic) or the Foundry (Empire) flashpoints. Once all the parts have been collected, the player must return to the Fatality wreck on Belsavis and defeat a Sith of the Dread Host known as "The Lord of Agony," after which they can claim their HK-51.
Players of both factions obtain slightly different versions of HK-51, featuring unique conversations and ambient dialogue, as well as a list of three targets, one of whom the player must select for HK-51 to assassinate. However, during the Knights of the Fallen Empire expansion, the characters of the original eight classes disappear, and HK-51 reappears as the Commander's droid, provided that the player unlocked him prior to the expansion. HK-51 provides commentary on the surrounding environment only on Makeb and participates in the cutscene between the player and HK-47 during the "False Emperor" flashpoint, where HK-51 asserts that HK-47 is an inferior model, while HK-47 maintains that he remains the pinnacle of HK droid models.