- "We Lannisters claim our descent from the Andal invaders and, through the female bloodline, Lann the Clever. According to the legend, Lann, using only his wits, won Casterly Rock from the noble house of Casterly during the Age of Heroes."
- ―Tywin Lannister
There are many stories about Lann that contradict each other. The most common story states that Lann frightened the Casterlys out of their home by making them believe that Casterly Rock was haunted, whispering threats to the sleeping residents and making ghostly sounds in the night. Another, a favorite of Tyrion, states that Lann snuck into the castle and fathered enough bastards with Casterly girls for the Casterlys to be forced to accept his rule.
In the books
In the A Song of Ice and Fire novels, Lann the Clever is the founder of House Lannister and a popular character among singers and storytellers. One of the stories narrates how he stole gold from the sun to brighten his hair.
There are many different and contradictory myths about Lann the Clever, assuming he actually existed, which only share the basic description that he swindled Casterly Rock from House Casterly "using only his wits" - though there are even rival tales about what specifically winning it "by his wits" involved. Some stories say that he found a secret tunnel into Casterly Rock, and snuck around inside causing intrigue between the Casterlys, stealing treasures from one brother's chamber and planting them in another's to cause strife, until ultimately the Casterlys killed each other and Lann took over, and possibly finished off any survivors. Other tales say that he used the secret tunnel to infest the castle with rats and vermin, until the Casterlys fled - while yet other tales say that he managed to sneak lions into the castle, who killed several Casterlys and caused the rest to flee. The more pragmatic story is that Lann was simply a man-at-arms in the castle, who impregnated Lord Casterly's daughter, and ended up marrying the girl. Because there were no other heirs left, when Lord Casterly died Lann became the new Lord of the Rock through his child. This story also has several variants, as in some there simply was no other heir, while in others Lann had married a low-ranking daughter and had to "use his wits" in various palace intrigues to increase his power and eliminate rival heirs who were further ahead in the line of succession.
Even Lann's origins are not clear in the legends. Some say that he was actually an Andal adventurer who came to the far west, though others dismiss this because the main Andal invasion didn't occur until thousands of years later. Then again, it is not outright impossible that he was simply an Andal adventurer (or perhaps exile) who wandered all the way to the far side of Westeros. Even so, most versions of the story do assume that he was simply one of the First Men, the only human settlers of Westeros at the time. Whatever the case, the rulers of Casterly Rock eventually married into invading Andal families and the "modern" House Lannister came to be.
The legends don't even specify if Lann the Clever lived before or after the Long Night, though no specific mention of it is made in the narrative of the Lannisters' history after that. This implies it had already happened and that Lann was not a contemporary of Bran the Builder, founder of House Stark (in contrast, some stories say that Bran was a contemporary of Durran Godsgrief, the first Storm King, though those legends may be pure inventions). On the other hand, the legends don't explicitly state that Lann lived after Bran the Builder and the Long Night either. The legends are vague, and many wonder if any of these figures from the Age of Heroes were ever truly real people at all, even disregarding the possibility that real men inspired the legends which were then embellished over subsequent centuries.
On one other point the tales all agree: Lann never called himself a "king". The Casterlys were very rich but they had not called themselves "kings", and Lann didn't crown himself when he took over Casterly Rock. The Lannisters only started calling themselves "kings" many generations later, after their steadily accumulating wealth made them very powerful (though still long before the Andal invasion).
In different versions of the tale, Lann is a bastard son of either Florys the Fox (ancestor of Houses Florent, Ball, and Peake) or Rowan Gold-Tree (founder of House Rowan). In both cases he is a grandson of Garth Greenhand and closely related to the founders of many Great Houses. In fact, he would be the first cousin of Bran the Builder, the founder of House Stark, if it is true that Brandon of the Bloody Blade was the Builder's father. However, a more common version of the tale in the westerlands claims that Lann was not related to the Greenhand, but deceived him by posing as one of his many sons and making off with part of the family's inheritence upon the High King's death. Some even state that Lann was an Andal adventurer from Andalos, though this would have been thousands of years before the coming of the Andals.