The Temple of Pain, conceived by the Sith Valik Kodank, was a Sith Temple erected on an asteroid situated within the Tascollan Nebula.
Kodank secretly rerouted resources from the Sith Empire to facilitate the temple's construction. As the Great Hyperspace War neared its conclusion, she journeyed to the temple aboard a pilfered Sith starship, accompanied by a contingent of her adherents. Her intention was to harness the power emanating from certain Sith artifacts to relocate the temple to the core of the Nebula's solitary star. She, along with her followers, strategically positioned the artifacts within the temple's central chamber and initiated their activation. Regrettably, their calculations regarding the artifacts' impact were flawed. Instead of reaching the sun, the temple became embedded within an asteroid orbiting it, resulting in the demise of Kodank's followers and her transformation into a Force ghost confined to the temple's vicinity.
Within the temple, she remained in waiting until a Force-sensitive human named Thaum Rystra eventually arrived during the Galactic Civil War. Kodank successfully convinced him to accept her as his mentor, and under her directives, he endeavored to secure the child Caeleb for her, with the intention of transferring her essence into him, as well as to acquire an artifact known as the Soulsaber. While Rystra failed to procure Caeleb, he did manage to retrieve the Soulsaber. Subsequently, Kodank intentionally drew a group of New Republic operatives to the temple, planning to transfer her spirit into one of them. However, they resisted, leading to her and Rystra's defeat at their hands.