Great Legend War

The Great Legend War is the first invasion of Earth by the Empire of Zangyack which united the first 34 Super Sentai teams.

Beginnings
The Great Legend War was Earth's greatest crisis of all time. The overwhelming forces of the Zangyack Empire]] which seeks to rule the entire universe, was on a campaign of destruction driving people into the very depths of fear. But the Earth possessed forces that could stand against this abominable evil. The defenders of love, dreams and peace. The thirty-four Super Sentai who dedicated themselves to protecting the happiness of the people.

From above, countless Zangyack Battleships bombarded cities while hundreds of Gormin troops led by their Zgormin commanders fought against opposition. How long the war lasted until the Super Sentai sacrificed their powers is unknown, though it is known that before the final confrontation, there was a massive battle where over 100 robots/giants fought against the Zangyack fleet. Many of the robots were destroyed or killed during this battle.

Final Battle
"Everyone! We must combine the power of all Super Sentai, and defend the Earth!"

- AkaRanger tells the 34 Super Sentai to sacrifce their power

Seemingly shortly after the mecha battle, the Goseigers were outnumbered by the Space Empire Zangyack after Gosei Great was heavily damaged. They were joined by AkaRanger and Big One, who told the Goseigers to join them in assembling all of the Super Sentai Groups to defeat the invaders. DekaMaster, DekaSwan, Black Knight, Princess ShinkenRed, Wolzard Fire, MagiMother, Zubaan, Signalman, Rio and Mele appeared to clear a path for the heroes. All 34 Super Sentai groups converged and topple whole squadrons of Gormin Sailors and Sugormin Non-Commissioned Officers, but were overwhelmed by the Zangyack battleships.

AkaRanger gave the order for all of the groups to combine their powers into one attack, which wiped out the entire Zangyack invasion fleet. Consequently, all of the Super Sentai warriors lost their powers, which were dispersed all over the universe in the form of Ranger Keys. This was observed by AkaRed, a hero who first appeared five years ago. On Earth, the heroes awoke to discover that they had no powers, Alata (GoseiRed) believed they still can protect the planet without their powers as the teams went their separate ways.

Zangyack

 * Zangyack Battleships (Hundreds?)
 * Sugormin (Hundreds?)
 * Gormin (Thousands?)

Trivia

 * The Great Legend War is depicted in episode 1 of Gokaiger, The Space Pirates Appear, and the 35th anniversary movie, Gokaiger Goseiger Super Sentai 199 Hero Great Battle.
 * Dead heroes like Rio, Mele, Burai and etc were brought back to life to fight in the Legend War. Who brought them back isn't clear. Apparently Rio and Mele being killed in the series and then revived to fight Long in Go-onger vs. Gekiranger is mentioned in the 199 Hero Movie pamphlet as something that happened, so this adds a bit more evidence that Gokaiger incorporates everything as "canon."
 * According to the pamphlet, there was a massive battle that happened prior to the main battle in the Legend War where over 100 robots/giants fought against the Zangyack fleet. Many of the robots were destroyed or killed during this battle.
 * This could explain why NinjaMan/SamuraiMan and Gunmajin do not appear.
 * Two other series have had similar battles: In Kamen Rider Decade (where it was done first), it was the Rider War, which saw various Riders battle and fall to the titular hero. In the anime movie Pretty Cure All-Stars DX 3, the heroines sacrifice their powers and companions to stop a massive menace from overtaking the Earth. Note that both the Decade and Pretty Cure examples were undone in some way at the end.