In the year 18 BBY, Apailana, the Queen of the planet Naboo, severed all diplomatic connections with the Galactic Empire. This action prompted the Empire to deploy the 501st Legion with the mission of crushing the burgeoning resistance on Naboo and regaining control of the planet.
Queen Apailana's subtle yet firm rejection of the New Order led the Empire to become suspicious of her true loyalties.
This uneasy situation persisted for a year. Then, Darth Vader discovered that the people of Naboo were sheltering Jedi refugees who were trying to escape the Great Jedi Purge. Emperor Palpatine then ordered Apailana's execution on the grounds of treason. Anticipating that her own guards would expect an assassination attempt, Palpatine instructed Vader to dispatch the 501st Legion, an elite unit of stormtroopers, to subdue the Royal Naboo Security Forces.
When the city refused to surrender its queen, the 501st immediately laid siege to Theed, Naboo's capital. Nonetheless, valiant Naboo security guards and police bravely defended their city using turrets and AAC-1 speeder tanks. The 501st Legion landed in the royal plazas and engaged the Naboo soldiers nearby, swiftly securing their landing zone.
Theed Royal Palace was heavily defended by a network of potent particle cannon turrets, controlled by a defense console grid near the palace gates. Despite this resistance, Imperial forces managed to establish a secure offensive position around the main gates.
To stall for time and prevent the queen's escape, the 501st decided to encircle the queen and her palace. Concentrating their forces on three key strategic points, stormtroopers advanced from right to left, establishing a defensive line. Commanders then successfully pinpointed the precise location of the main defense grid console, giving the Imperials a difficult but clear opportunity to neutralize the defense turrets.
Supported by fire from a TX-130T fighter tank, 501st Legion stormtroopers fought their way onto the balcony where the auto-turret grid console was guarded. They bombarded the area with grenades, eliminating the guards and destroying the console, thereby disabling the grid.

Imperial troopers engaged in skirmishes with Naboo forces within Theed Palace. Shortly after the defensive turrets were deactivated, several Jedi Masters and Padawans whom the queen had been sheltering broke free from the castle. Although formidable, the Jedi were outnumbered and surrounded by the elite Imperials. They were ultimately exterminated, but not before inflicting heavy casualties on the stormtroopers who directly attacked them.
Left with no alternative, the queen and her small group of Jedi protectors desperately attempted to escape, driving directly into the main Imperial force. As documented in the journal of a retired clone trooper, a sniper concealed on a bridge fatally shot the queen with a high-powered sniper rifle. The remaining Jedi were then surrounded and executed by stormtroopers.

The security personnel, palace guards, and police officers were captured and, like many of the Empire's prisoners, were said to have "disappeared." In reality, they were transported to the secret, still-under-construction Death Star for imprisonment. Most of them would later join Rebel inmates and perish fighting in the subsequent Death Star Uprising.
To conceal the truth, the Empire declared that terrorists had attacked Theed Palace and that the 501st Legion had arrived to quell the chaos, with the Queen being killed "just before she could be saved" during the intense fighting. The Royal Security Forces, however, were never given a chance to present their version of events.
According to an Imperial Officer overseeing the stormtrooper's efforts, the event would intimidate potential rebels into submission, thereby "saving countless lives." However, it ultimately had the opposite effect.
On Naboo, the Empire proceeded to install a puppet monarch and government (led by Queen Kylantha) that would be completely compliant. The Royal Naboo Security Forces was severely restricted to a small, select group of bodyguards (chosen by the monarch), who were believed to be incapable of initiating another uprising.
Nevertheless, the remaining security forces, along with other Naboo opposed to Imperial rule and supported by Gungan Rebels, managed to rise up against the disorganized Empire during the Uprising on Naboo in 4 ABY.
The Battle of Naboo made its first appearance in the Pandemic Studios video game Star Wars: Battlefront II, which launched on November 1, 2005.