Long Night

"Thousands of years ago, there came a night that lasted a generation. Kings froze to death in their castles, same as the shepherds in their huts; and women smothered their babies rather than see them starve, and wept, and felt the tears freeze on their cheeks... In that darkness the White Walkers came for the first time. They swept through cities and kingdoms, riding their dead horses, hunting with their packs of pale spiders big as hounds."

- Old Nan to Bran Stark

Eight thousand years before the Targaryen Conquest, a winter known as the Long Night descended upon the world, which lasted an entire generation. Thousands starved as the crops and fields lay buried under dozens of feet of snow. In the darkness and cold of the Long Night, the White Walkers descended upon Westeros from the farthest north, the polar regions of the Lands of Always Winter. The conflict that arose from the Long Night is known as the War for the Dawn.

The War for the Dawn
None knew why the White Walkers came, nor their nature and origins, but they killed all in their path. The White Walkers reanimated the dead as Wights to kill the living at their command, and soon the White Walkers led their hordes of undead to sweep across the continent.

Eventually the First Men and the Children of the Forest rallied to defend themselves and in a conflict known as the War for the Dawn, the White Walkers were defeated and driven back into the uttermost north.

The Wall was constructed along the northernmost isthmus of northern Westeros to bar their return, a massive fortification standing seven hundred feet high and stretching from one side of the continent to the other. Legend says that the Wall was infused with powerful magic spells by the Children of the Forest that prevent the White Walkers from crossing it. The ancient order of the Night's Watch was founded to defend the Wall should the White Walkers return to invade the realms of men once more.

Aftermath
In the present day, most believe that the Long Night is just a children's story, and that the White Walkers are nothing more than legends. Even the few who believe they did once exist think they went extinct thousands of years ago. Certainly, none were seen for the next eight thousand years between their supposed defeat and the time of Robert's Rebellion.

As the War of the Five Kings begins, disturbing reports have come back from the scouts of the Night's Watch that for reasons as yet unknown, the White Walkers have begun to return. Given that the great lords of Westeros are short-sightedly more concerned with fighting each other for control of the realm, most have simply ignored the warnings of the Night's Watch, to focus on their civil war. This leaves only the under-supported and under-manned Night's Watch to stand between the White Walkers and the realms of men.

Season 1
After Catelyn Stark leaves for King's Landing, Old Nan sits by Bran Stark’s bedside to watch him. She suggests the story of Duncan the Tall and Bran replies that he hates her stories —he prefers the scary ones. She retorts that he is a "sweet summer child" who knows nothing about fear, and tells him that fear is for the winter and for the Long Night, a winter season thousand of years ago that lasted a generation, in which those who didn't freeze to death had to face the White Walkers, who ventured south for the first time and swept through Westeros.

Season 5
During Stannis Baratheon's march to Winterfell, the weather turns for the worse and a snow storm delays his army. In order to better their chances of winning the upcoming battle in the snow which they both saw in the flames, Melisandre tries to convince Stannis to sacrifice more King's blood —this time, Stannis' own daughter, Shireen. Stannis is visibly shocked and disgusted by the suggestion, asking her if she has lost her mind. She insists that Stannis must be the undisputed king when the the Long Night comes, but he rebuffs her and orders her to leave his presence.

When Lord Commander Jon Snow and the wildling envoy Tormund travel to Hardhome to convince the Free Folk sheltered there to come back with them to Castle Black in order to settle south of the Wall, Jon Snow argues that the Long Night is coming and the dead come with it —and only together they can give the White Walkers a fight, and maybe even beat them back. Snow's words prove immediately prophetic, as during the process of taking the wildlings to the ships the White Walkers arrive with thousands of wights and massacre most of the Free Folk.

In the books
As of the fifth novel in the A Song of Ice and Fire series, A Dance with Dragons, very little detail has been given about what actually happened in the War for the Dawn. Written history doesn't date back that far, so only oral tradition and half-mythical accounts come down to the present. There are vague legends that a single First Man- whom Old Nan refers to in her stories as "the last hero"- unified both the First Men and the Children of the Forest and led them to victory.

There are also stories about the Long Night in Essos. Cultures throughout the continent have various legends of ancient cataclysms, all of which (supposedly) occurred around the same time as the generation-long winter in Westeros. According to Melisandre, a hero known as "Azor Ahai" wielded a flaming sword named Lightbringer in battle against the darkness to win back the dawn. The holy texts of the Lord of Light say that there will come a time when the darkness will return, and Azor Ahai will be reborn to lead the people of the world to victory once again.

According to Rhoynar legends, in the region of the future Free Cities the mighty Rhoyne River froze as far south as its tributary the Selhoru (about as far south as Myr and Tyrosh) - a claim which the maesters have confirmed with reasonable certainty. The Rhoynar believed that the Long Night ended when a single hero beseeched Mother Rhoyne, the goddess of the river, along with the minor deities that were her children to join together and sing a magical song which brought back the dawn.

In the legends of Yi Ti in far eastern Essos, the Lion of Night fathered a child on the Maiden-Made-of-Light who was known as God-on-Earth, first emperor of Yi Ti's Great Empire of the Dawn (which is semi-mythical, and allegedly existed in the Dawn Age before the Long Night). Later, a descendant of God-on-Earth known as the Amethyst Empress was usurped and murdered by her own brother, an event known as the Blood Betrayal. This caused the Maiden-Made-of-Light to turn away from humanity in shame, and the Lion of Night came forth in all his wrath to punish mankind's wickedness, inflicting the cold and darkness of the Long Night.