The conflict known as the Battle of the Great Pit of Carkoon, alternatively referred to as the battle over the Great Pit of Carkoon, or simply the Battle of Carkoon, unfolded in 4 ABY. This engagement was part of Luke Skywalker's broader effort to liberate his friend, Han Solo, who was being held captive by the crime lord Jabba the Hutt. After their attempt to infiltrate Jabba's palace failed, Jabba sought to execute Luke Skywalker, Han Solo, and Solo's Wookiee companion Chewbacca by casting them into the Great Pit of Carkoon, the habitat of the monstrous Sarlacc.
Skywalker had anticipated such a predicament. Before the rescue mission, he had concealed his newly built lightsaber within his astromech droid, R2-D2. As the execution was about to commence, the droid launched the lightsaber into the air, enabling Skywalker to arm himself and swiftly subdue Jabba's guards. Amidst the resulting pandemonium, Leia Organa, who had been captured by Jabba and forced into servitude, assassinated Jabba. Simultaneously, Boba Fett, a renowned gunfighter and associate of Jabba, was inadvertently knocked into the Sarlacc's waiting maw by Solo.
Years prior to these events, Jabba had contracted Han Solo to transport spice for him. However, during one such smuggling operation, Solo's vessel was intercepted by Imperial forces, compelling him to jettison the spice to avoid arrest. Unable to repay his debt to Jabba, Solo found himself with a bounty placed on his head by the Hutt. Years after the initial bounty, Boba Fett tracked Solo to Cloud City on Bespin. There, Darth Vader captured, tortured, and froze Solo in carbonite, before handing him over to Fett for delivery to the Hutt crime lord. Following a period of searching for Boba Fett, including a near miss on Gall, the Rebels discovered that Solo had been delivered to Jabba.

Lando Calrissian had already infiltrated Jabba's Palace under the guise of a guard named Tamtel Skreej, in preparation for potential emergencies. Subsequently, Luke Skywalker dispatched his droids, R2-D2 and C-3PO, to deliver a message to Jabba the Hutt. The holographic message conveyed by the droid requested Solo's release in exchange for a mutually beneficial arrangement with the young Jedi. The droids were also presented as gifts to demonstrate Skywalker's desire for a peaceful resolution rather than conflict. Jabba, however, declined to cooperate and relinquish his prized captive.
In the subsequent phase of the rescue plan, Leia Organa, disguised as the bounty hunter Boushh, brought a "captured" Chewbacca to the palace, intending to collect the bounty on his head. Jabba initially offered 25,000 credits for the Wookiee, but ultimately paid her 35,000 credits following intense negotiations involving a thermal detonator. Later that night, Organa stealthily entered Jabba's throne room and attempted to free Solo from the carbonite. However, before they could escape, they were apprehended. Jabba, having anticipated the escape attempt, had not trusted Boushh and was lying in wait. Jabba imprisoned Solo with Chewbacca and added Organa to his collection of slave girls.
Luke Skywalker then arrived with the intention of freeing his companions. He bypassed Jabba's Gamorrean guards with ease and employed a Jedi mind trick on Bib Fortuna to gain access to the Hutt's throne room. However, the Hutt crimelord proved resistant to the Jedi's influence, being immune to mind tricks. He refused to release Luke's friends. When Skywalker attempted to eliminate the Hutt with a blaster he had acquired, Jabba activated a trapdoor, sending him into the rancor pit. After evading the rancor, Skywalker used a skull to trigger the gate-control switch, causing the heavy gate to fall and impale the rancor through the neck. Enraged, Jabba ordered Skywalker, Solo, and Chewbacca to be brought before him, where he sentenced them to death by being fed to the sarlacc. Upon hearing that they were to be executed, Solo initially quipped that he "hated long waits," but quickly changed his mind upon learning the specific details of the planned execution.

The three prisoners were transported to the Great Pit of Carkoon aboard a desert skiff, while Jabba, his entourage, and Leia observed from the Khetanna, Jabba's personal luxury sail barge. While on the skiff, Luke offered Jabba a final opportunity to release him and his friends, warning that refusal would result in Jabba's demise. Skywalker was then forced to jump, but he spun in the air and grabbed the end of the plank, using it to launch himself back onto the skiff. Unbeknownst to everyone except Skywalker, R2-D2 was concealing Luke's newly constructed lightsaber. After reaching the deck of Jabba's sail barge, Artoo launched the lightsaber into the air, where it landed in his master's hand. As the surprised guards prepared to defend themselves, Luke slashed through them, sending them over the edge and into the pit and the sarlacc's maw. Boba Fett, seeking to eliminate the Jedi, propelled himself from the barge to the skiff. As Fett raised his EE-3 carbine rifle, the Jedi bisected the weapon with his lightsaber. When Luke's attention was momentarily diverted, Fett ensnared him with a fibercord whip, but the Jedi freed himself, knocking Fett to the ground in the process.
He then jumped onto the second skiff and began deflecting incoming blaster fire. Capitalizing on this distraction, Fett prepared to shoot him. With Fett now focused on Skywalker, Solo, still suffering from the effects of hibernation sickness caused by being frozen in carbonite, inadvertently struck Fett's jetpack with a vibro-ax, having panicked when Chewbacca alerted him to Fett's presence behind him. Solo's actions caused Fett's jetpack to malfunction, sending Fett crashing into the side of the sail barge, ultimately causing him to fall into the sarlacc's mouth, which then emitted a loud belch after swallowing him.

Lando Calrissian, still disguised as the guard Tamtel Skreej, aided in defeating some of the guards on the skiff. During the conflict, he was knocked into the Pit of Carkoon. Han and Chewbacca attempted to rescue their friend by lowering a vibro-ax, but the sarlacc seized Lando's leg and began pulling him in. Han managed to free Lando by shooting the beast with a blaster, his eyesight returning just in time, forcing it to release him.
Observing that the skiffs were sustaining heavy fire from the deck-mounted blasters on the Khetanna, Skywalker leaped onto the barge and scaled the side to reach the upper deck. There, he engaged Jabba's henchmen, knocking many of them overboard into the pit. He also quickly eliminated the guard operating the heavy cannon.

The Rebels received assistance from some of Jabba's disloyal henchmen, such as Ree-Yees, a Gran who did not intervene when Leia Organa strangled Jabba to death. Although not a rebel sympathizer, Hermi Odle also inadvertently provided assistance by taking advantage of the chaos and shooting his rival, Pote Snitkin.
As the battle raged outside, Organa used the confusion to cut power inside, closing the side viewports and plunging the interior into darkness. In the chaos, she wrapped her chain around Jabba's body and, exerting all her strength, choked him to death. With assistance from R2-D2, she freed herself from her chains. Salacious Crumb began to rip out Threepio's wires from the droid's photoreceptors, but Artoo shocked Salacious away from Threepio. The droids then hurried to join Skywalker on the deck. Skywalker instructed Organa to aim the cannon at the deck of the barge, at which point Taym Dren-garen shot his right hand, exposing his mechanical limb, but the Jedi quickly recovered and continued to prevent any guards from reaching the cannon. R2-D2 pushed C-3PO from the barge and both droids landed getting partially buried in the sand. Skywalker swung with Organa from the barge to the skiff just as he kick-started the blaster cannon. After picking up the droids, Calrissian piloted the remaining skiff with all the rebels aboard safely away from the ensuing explosion of Khetanna.

Boba Fett survived his ordeal in the sarlacc pit, emerging days later thanks to his Mandalorian armor and strong will. He was discovered by a fellow bounty hunter, Dengar, and Kateel of Kuhlvult who provided him with medical care. Kuat of Kuat, the leader of Kuat Drive Yards, then arranged a bombing run on the Great Pit of Carkoon to ensure the death of Boba Fett but the bounty hunter managed to escape.
Jabba's death resulted in the cancellation of many debts, leading to widespread gratitude toward Luke for eliminating that dangerous complication in their lives. This event led to the permanent weakening of the Hutt Cartel and the temporary disruption of Jabba Desilijic Tiure's criminal empire. In retaliation for his son's death, Zorba the Hutt placed a bounty on Organa, which the Desilijic kajidic later extended to Solo, Chewbacca, and Skywalker. The bounty remained active until Organa's election as Chief of State, as the Hutts sought to avoid further antagonizing the New Republic.

Numerous individuals who had been enslaved by Jabba gained their freedom and started new lives, including Doallyn, the dancer Yarna d'al' Gargan, and the members of the Max Rebo Band.
Skywalker and the other Rebels subsequently participated in the Battle of Endor, where the Jedi defeated Darth Vader and Emperor Palpatine met his end. The Death Star II was destroyed, marking the Rebel Alliance's most significant victory in the Galactic Civil War. However, one year later the criminal empire was resurrected by Jabba's father and nephew.
In 44 ABY, after Jaina Solo, Leia's daughter, sensed a Hutt in the Old Town on Sakuub, Jagged Fel, her husband, briefly referenced Leia's killing of Jabba as an explanation of his slithering out of sight in the event that the Hutt knew who Jaina and Fel were.
The Battle of the Great Pit of Carkoon was initially depicted at the beginning of the 1983 film Star Wars: Episode VI Return of the Jedi, the concluding installment of the Star Wars original trilogy. Contrary to popular belief that George Lucas conceived the battle, it was actually the creation of writer and director Richard Marquand and Lawrence Kasdan. This fact was later revealed through transcripts of meetings from The Making of Return of the Jedi.
Lawrence Kasdan proposed killing Jabba the Hutt during the battle, while George Lucas suggested having Leia Organa strangle him with her chain as a tribute to Francis Ford Coppola's 1972 classic film The Godfather, mirroring the scene in which Luca Brasi is garrotted by Virgil Sollozzo and his men.