Shakespeare based Hamlet on the Scandinavian legend of Amleth, recorded by Danish historian Saxo Grammaticus in Gesta Danorum (12th century). Key parallels: a prince feigns madness to avenge his father's murder by his uncle, who has married his mother. Shakespeare expanded the skeleton into a profound psychological tragedy, adding the ghost, the play-within-a-play, Ophelia's madness, and the philosophical depth that makes Hamlet literature's most introspective protagonist.