The eradication efforts spearheaded by Sith Lord Darth Sidious after establishing the Galactic Empire in 19 BBY to completely destroy the Jedi Order are known as the Great Jedi Purge, which was later also called the Second Jedi Purge or Palpatine's Purge. This resulted in the near-total destruction of the Jedi, mirroring the First Jedi Purge that happened after the Jedi Civil War.
Following a failed attempt by Mace Windu and three other Jedi to take Supreme Chancellor Sidious into custody, Order 66 marked the official beginning of the purge. The Grand Army of the Republic was commanded to turn against the Jedi, who were branded as enemies of the Republic.
Now the Emperor of the Galactic Empire, Sidious deployed his new apprentice, Darth Vader, alongside other Imperial agents to relentlessly hunt down and assassinate the remaining Jedi. Some Jedi, like Roan Shryne, and those who attended the Conclave on Kessel, bravely fought the Empire until their last breath. Others, such as Obi-Wan Kenobi and Yoda, went into hiding to evade the Empire's grasp.
In the nineteen years following Order 66, many Jedi were defeated by Vader, Inquisitors, Emperor's Hands, Dark Jedi, and even bounty hunters. By 1 BBY, the Emperor, judging the Jedi as no longer a threat due to their dwindling numbers, brought the Purge to an end.
After Anakin Skywalker discovered that Palpatine, the Supreme Chancellor, was in reality Darth Sidious, the elusive Sith Lord the Jedi had been searching for for over a decade, Jedi Master Mace Windu, along with Agen Kolar, Kit Fisto, and Saesee Tiin, formed a small team of Jedi Masters to apprehend Sidious. Sidious swiftly eliminated Agen Kolar, then Saesee Tiin, and, after a more challenging fight, Kit Fisto, leaving Windu to confront the Sith Lord alone.

During the subsequent duel between Windu and Sidious, Windu gained the upper hand and disarmed Sidious just as Anakin entered the room. Sidious then unleashed Force lightning at Windu, who redirected it, causing Sidious's face to become disfigured, yellowed, and scarred by the dark side. Windu then prepared to deliver the final blow to Sidious.
To protect Sidious, whom Anakin believed was the only one who possessed enough knowledge of the dark side of the Force to save his wife, Padmé Amidala, from dying, Anakin made the choice to betray Windu and render him helpless. He ignited his lightsaber to block Windu's attack on the Chancellor, severing the Jedi Master's saber hand. Then, Sidious, who had pleaded with Anakin for assistance and begged Windu not to kill him due to his apparent weakness, immediately found the strength to strike Master Windu with Force lightning, sending him plummeting to his death from the window.
Anakin was immediately filled with horror at his actions, but despite his guilt, or perhaps because of it, he was unable to resist the allure of the dark side, nor could he simply allow Padmé to die when Sidious (allegedly) had the power to save her. Anakin betrayed the Jedi, pledged allegiance to Sidious, became his new apprentice, and was given the Sith name Darth Vader.
Sidious quickly announced that the Jedi's attempt to apprehend him was an act of betrayal against the Republic by the Order, and used this as justification for his ultimate objectives. Palpatine ordered the Grand Army of the Republic to carry out Order 66—the complete extermination of all Jedi "traitors" across the galaxy as a signal that the era of the Jedi had ended and the New Order was now in power.
In addition to the Jedi's attempt to arrest Sidious, another justification for the Order's obliteration was the claim that they were complicit in starting the Clone Wars to destabilize the galaxy and overthrow the government. Evidence cited to support this claim included the Jedi's unauthorized involvement in initiating the creation of the clone army without the Senate's approval, and the role of former Jedi Count Dooku in establishing the Separatist movement.

Simultaneously, Sidious dispatched Vader and the 501st Legion to eliminate all the Jedi within their Temple on Coruscant. The newly crowned Emperor defended his purge with a complex conspiracy theory alleging that the Jedi had attempted to seize control of the Republic by assassinating the head of government, taking control of the clone army, and even murdering all members of the Galactic Senate, using manipulated audio recordings of his battle with Mace Windu as proof.
The Empire estimated that less than one hundred Jedi managed to escape the betrayal by Vader and the clone troopers they commanded during the war. Because Jedi Knights were thought to be more likely to fall victim to Order 66, it is believed that Jedi Masters had a higher chance of surviving the genocide than Jedi Knights, with the exceptions of few survivors like Ylenic It'kla, Rachi Sitra, Corwin Shelvay and Empatojayos Brand. Among the few survivors were Jedi Masters: Obi-Wan Kenobi, Yoda, Shaak Ti, Echuu Shen-Jon, Qu Rahn, Rahm Kota, K'Kruhk, T'ra Saa, Tholme, A'Sharad Hett and Quinlan Vos. Many Jedi that did survive, like Kai Hudorra and Roan Shryne, cast aside their lightsabers, realizing that their roles as keepers of the peace were over, only to be cut down by Darth Vader himself. Other Jedi, such as Olee Starstone and Dass Jennir, kept fighting the Empire, and tried to contact the other Jedi. Kenobi and Yoda secretly escaped to Tatooine and Dagobah, respectively. Rahm Kota secretly attacked many Imperial shipments and traveled all over the galaxy being a thorn in the side of the Galactic Empire. However, before hiding, Obi-Wan and Yoda altered a return call being sent from the Temple into a warning to stay away; as a result, several other Jedi survived the immediate purge. Most survivors fell to Vader, but some others fell to Jedi hunters, including the Emperor's Hands, Dark Jedi, and even a handful of bounty hunters.
Roughly a month after the issuing of Order 66, the Jedi Shadday Potkin issued a call for a Conclave on Kessel to deliberate on strategies against the Imperial effort to wipe out the remaining Jedi. A group of seven surviving Jedi, including Bultar Swan and Tsui Choi, convened on Kessel. However, the conclave was actually a trap set to capture and kill Vader.
A false report that his former Master, Obi-Wan Kenobi, would be among the Jedi motivated Vader to act. Despite Obi-Wan's absence, Vader demanded his location from the Jedi, threatening them with death. They did not cooperate with his request (in truth, none of them knew where Kenobi was anyway) and, although they put up a valiant fight, no Jedi survived. Potkin's trap for Vader resulted in nothing more than the deaths of more Jedi.

Rumors spread that the conclave consisted of fifty Jedi, each easily killed by the Dark Lord. In truth, Darth Vader fought only eight with difficulty. However, to cement Vader's image and invoke fear in the remaining Jedi, the Emperor declared the rumors true. Official reports, fabricated by Sate Pestage, stated that some of the Jedi had either been executed for numerous crimes, or that they killed each other in duels for leadership.
Immediately after Order 66 was issued, Jedi Padawan and survivor Olee Starstone began searching for any surviving Jedi. One destination she investigated was Kashyyyk, where Masters Yoda, Luminara Unduli, and Quinlan Vos had been stationed when the Order was transmitted from Coruscant. She arrived on the planet along with several other Jedi survivors—Siadem Forte, Deran Nalual, Klossi Anno, Iwo Kulka, Jambe Lu, and Nam Poorf, as well as the slicer Filli Bitters. After meeting with Tarfful and Chewbacca, the Jedi learned of Yoda's survival. The Wookiees offered the band of Jedi safe harbor on Kashyyyk, but a CR25 troop carrier arrived at Kachirho, interrupting their meeting.
Shortly after the arrival of the Jedi, the Sith Lord Darth Vader had arrived in the Kashyyyk system, along with the Imperator-class Star Destroyer Exactor, where it joined Wilhuff Tarkin and Executrix. The two planned their attack on Kashyyyk—Vader interested in destroying the fugitive Jedi, Tarkin interested in enslaving the Wookiees for use in the construction of the Death Star. Although the fleet commanders were eager to bombard the planet, Vader overruled them, ordering a direct assault on several cities including Kachirho, Rwookrrorro, Kepitenochan, Okikuti, and Chenachochan.
At Kachirho, the landed Imperial troops ordered the Wookiees to hand over the fugitive Jedi. The enraged Wookiees attacked the troops, and Starstone and her Jedi soon joined the battle. As more Imperial forces landed, the Wookiee warriors and the Jedi covered the evacuation of Kachirho, as countless Wookiees fled the Imperial troopers, fleeing from enslavement. Imperial landers and gunships were engaged by Oevvaor jet catamarans, retrofitted with rocket launchers and other high-end military hardware, salvaged by the Wookiees from the remnants left over by the earlier Battle of Kashyyyk.
Meanwhile, Vader piloted a Theta-class shuttle. Eventually making a landing at Kachirho, Vader was confronted by Starstone and her Jedi cadre. Vader killed Forte and Kulka, and injured Lu, Poorf, and Anno, leaving only himself and Starstone in the fight.
The two briefly faced off, but Jedi Master Roan Shryne and the smuggler Archyr Beil arrived and intervened. Shryne slew Appo while Archyr dealt with the rest of the stormtroopers, and Shryne moved in to engage Vader in a vicious battle, buying Starstone and Archyr more time to escape with the injured Jedi. As Shryne and Vader dueled, the main battle began to drift east of the city, moving closer to the lake, as Imperial gunships and artillery drove the Wookiees down out of the city and towards the ground.
Abruptly, the Imperial gunships began to retreat from Kachirho, as the orbiting Star Destroyers began their orbital bombardment. Shryne and Vader's duel was interrupted by the strike, and the two moved inside one of the great wroshyr trees. Once inside, Vader used Force throw to throw planks of wood and other debris at Shryne, critically injuring the Jedi in the process and throwing him down from a high bridge. Seeing that Shryne was going to die, Vader chose not to finish off the Jedi, instead revealing his true identity to the man—Anakin Skywalker, who would be redeemed by his son, Luke Skywalker, during the Battle of Endor in 4 ABY.
As Shryne passed away, Victory-class Star Destroyers began to descend into the atmosphere, finishing the conquest of Kashyyyk. About two hundred thousand Wookiees, including Tarfful, were captured and moved to containment camps on the Wawaatt Archipelago. As a result, the Empire gained control of Kashyyyk, and gained a valuable labor source for the Death Star project.
Shortly thereafter, another Jedi was discovered taking refuge on Kashyyyk, and Darth Vader led an army, cutting through the forests trying to find him. Kento Marek was found and executed in front of his own son, Galen. Vader sensed potential in the boy, for Galen had actually used his Force abilities to pull Vader's lightsaber out of his hand. When a stormtrooper squad arrived to execute the boy, Vader killed them all, leaving no witnesses, and secretly took the boy under his training.

The monarch of Naboo, Queen Apailana, decided that the situation called for military—not diplomatic—action. She started sheltering fugitive Jedi on the run from the Empire. To crush the uprising on Sidious's homeworld, the 501st Legion invaded Theed and rushed into the plaza supported by TX-130T fighter tanks after disabling an auto-turret grid. The Jedi were killed by the stormtroopers, and Apailana was shot and killed by a sniper. With Naboo in line, the 501st gained the nickname "Vader's Fist."
Some years later, a surviving Separatist named Gizor Dellso found refuge on Mustafar. Dellso was the designer of the droid army deactivation signal, and using his knowledge, reactivated a dormant droid army on the planet and planned a revolution. Similarly, the Kaminoan government planned action against the Empire and had grown a clone army. The Clone Wars nearly began again, but Vader's Fist put down both of the revolts.

During the purge, Vader wiped out the farming colony of Talasea for harboring a Jedi. Vader and a number of stormtroopers also killed the last Curator of Records on Toola.
In 10 BBY, Inquisitor Antinnis Tremayne captured and tortured Jedi Master Darrin Arkanian and his apprentice, Corwin Shelvay, on Coruscant. In an escape attempt, Tremayne killed Arkanian in a lightsaber duel, only to have Shelvay seriously wound him before making it offworld. Tremayne required cybernetics to recover, and was afterward dispatched by Vader aboard Interrogator to scour the Outer Rim for Shelvay. Around this time, Imperial Sentinels were sent off Byss for the first time, to capture Ashka Boda. Bringing him to Coruscant in an Imperial dungeon ship, Sidious killed him and took the Tedryn Holocron.
Around 17 years into the purge, Jedi survivor Rahm Kota organized a militia and began attacking various Imperial targets. This was an attempt to lure Darth Vader out. Eventually attacking the TIE Fighter Construction Facility over Nar Shaddaa, Vader sent his apprentice, Galen Marek, Starkiller, to eliminate him, rather than coming personally as Kota expected. Kota was presumed dead in the ensuing battle, but somehow managed to survive the duel.

Starkiller, a tool of Vader's used in his plot to overthrow Sidious, was sent on two further assassination missions: Kazdan Paratus on Raxus Prime and Shaak Ti on Felucia. Paratus had gone mad and built a junk replica of the Jedi Temple on Raxus Prime, complete with mock statues of each of the Jedi High Council members, but was killed by Starkiller, along with his mock statues of the Jedi Council members being destroyed. Shaak Ti prepared for a possible revolution against the Sith, with her Padawan Maris Brood. She trained the native Jungle Felucians to use the Force and organized them. When Starkiller arrived, the two dueled on a massive Sarlacc pit. Ti warned Starkiller of the nature of the Sith Order before falling into the pit.
Sidious's spies had tracked Vader's apprentice back to the Executor. There, Sidious ordered Vader to kill Starkiller. Sidious would later find use of Vader's apprentice, and had Vader retrieve his body and bring him back to life, giving him a new mission: gather the enemies of the Empire into one place. Vader disguised this order as another plot to overthrow Sidious by giving him something else to pay attention to: an army of dissidents and rebels.
This new mission would lead to Starkiller tracking down a (alive) General Rahm Kota, who was blinded following his duel with Starkiller and became a drunk, supposedly losing his connection with the Force. Kota would lead him to rescue Princess Leia Organa and Senator Bail Organa. Him and Bail talked of rebellion, and would agree that they would need to show other possible rebels that the Empire was indeed vulnerable. This mission led him to destroy a Star Destroyer construction facility over Raxus Prime. This act would inspire senators Mon Mothma and Garm Bel Iblis to join Rahm, Marek, Leia and Bail Organa to sign the Corellian Treaty and officially organize the Alliance to Restore the Republic.
During this meeting on Corellia, Vader raided, revealing his ruse, and brought the rebel senators to be tortured, interrogated, and executed aboard the Death Star I. Marek would realize his inner Jedi self, traveling to the Death Star and nearly killing both Sith Lords, allowing the senators and Rahm to escape. He would lose his life in the process. The Galactic Civil War had officially started, which began to draw the Empire away from their Jedi hunting and toward destroying the rebellion Sidious had accidentally created.

Shortly before the Battle of Yavin, Vader tracked a female Human Dark Jedi down on the planet Dargulli. Despite the fact that she wished to become his Sith apprentice, Vader killed her. Around this time, Vader also killed the Dark Woman, who had been found on Cophrigin V by Mara Jade. Throughout the Purge, CorSec aided Vader and his agents in hunting Jedi within the Corellian sector.
By 1 BBY, the systematic Purge had concluded, but a few of the survivors would die in the years that followed—including Echuu Shen-Jon, killed by Vader on Krant, and Obi-Wan Kenobi, who sacrificed himself on the first Death Star to ensure the escape of his protégé, Luke Skywalker. As the Galactic Civil War turned in favor of the Rebels, surviving Jedi began to come out of hiding, becoming members of the Alliance, even sacrificing their lives for the return of the Republic and democracy. Famous examples include Echuu Shen-Jon, Rahm Kota, Qu Rahn, Corwin Shelvay and Rachi Sitra.

Following Kenobi's passing by four years, Yoda's life ended at the advanced age of 900. Anakin Skywalker, formerly known as Darth Vader, atoned for his past actions by making the ultimate sacrifice. He saved his son from being slain by Darth Sidious, his former master. This event occurred on the second Death Star during the Battle of Endor in 4 ABY. In 5 ABY, a year after the Battle of Endor, the Seven Dark Jedi captured Jedi Master Qu Rahn. A brief but intense battle ensued, ending with Jerec, a former Jedi who had become an inquisitor, killing Rahn aboard Jerec's flagship. Some known Jedi survivors would later become part of the New Jedi Order. Six years after the Battle of Endor, Empatojayos Brand gave his life to eliminate Palpatine's spirit on Onderon.
The intention behind the Purge was not only to eliminate the Jedi Order, both symbolically and in reality, but also to gather all of the Jedi's history, knowledge, and technology into Sidious's grasp. A significant number of holocrons, along with ancient techniques, training resources, and Jedi relics, were lost. This loss was mainly due to the efforts of Darth Vader, the Inquisitorius (Dark Jedi specifically tasked with finding and destroying any remnants of the Jedi Order), and the Imperial Security Bureau, which was in charge of erasing the Order's legacy. Luke Skywalker, while working to rebuild the Order, conducted extensive research with his relic hunters to find even the smallest pieces of information related to the old Order, especially on Onderon, where Jedi artifacts were discovered during Darth Sidious's resurrected reign in 10 ABY. However, not all Jedi writings and teachings were permanently lost. In the years following the Second Jedi Purge, even up to events after the Third Jedi Purge, the New Jedi Order rediscovered ancient Jedi artifacts throughout the galaxy, notably on homeworlds that played a significant role in the Jedi Order's history, such as Tython, Ossus, Ilum, Dantooine, and others.
By 1 BBY, it was widely believed that the Great Jedi Purge had come to an end after almost nineteen years of the systematic slaughter of Jedi. Although any remaining Jedi were still to be executed if found, the Empire was no longer actively searching for them. The Emperor was aware that there were still survivors, but he considered them too few to be a threat. While the whereabouts of dozens of Jedi remained unknown, only about thirty Jedi Masters, Knights, Padawans, and Initiates who still adhered to the Jedi way were definitively known to be alive at this time.
The Battle of Shumari stands out as perhaps the most devastating event of the Great Jedi Purge. In this battle, Imperial troops under Vader's command engaged a considerable number of Jedi survivors from Order 66. The battle concluded with the death of all but one Jedi, many of whom were killed by Vader himself. During the battle, Shumari was subjected to heavy orbital bombardment from orbiting Star Destroyers, which completely devastated the planet, rendering it uninhabitable and wiping out its entire population. Vader took the lone surviving Jedi as another secret apprentice, but the Emperor later forced him to kill the apprentice.
The details surrounding the Purge are further elaborated upon in the Expanded Universe. In contrast, the films only depict Yoda and Obi-Wan as survivors, while others are either killed off-screen or simply not mentioned at all. Some theorize that this aligns with George Lucas's original vision, suggesting that, according to G-canon, only these two were the true survivors. This is supported by Yoda's statement to Luke, "The last of the Jedi you will be." This statement appears inaccurate if other Jedi were still alive after Return of the Jedi, although it could simply refer to Jedi who still followed the Order's teachings. Many survivors, despite their Jedi training, stopped identifying as Jedi to survive in the changing galaxy and avoid the Purge's perpetrators. Therefore, from a certain perspective, Yoda and Obi-Wan were the last of the openly known Jedi. Alternatively, Yoda might have been unaware of other Jedi, or those Jedi might have already been hunted down or died. Furthermore, it is important to remember that during the events of Revenge of the Sith, Obi-Wan altered the beacon in the Jedi Temple to warn any surviving members of the Order to stay away, giving them a chance to escape the Purge.