Saxo Grammaticus (c. 1150 – c. 1220), also known as Saxo cognomine Longus, was a Danish historian, theologian and author. He is thought to have been a clerk or secretary to Absalon, Archbishop of Lund, the main advisor to Valdemar I of Denmark. He is the author of the Gesta Danorum, the first full history of Denmark, from which the legend of Amleth would come to inspire the story of Hamlet by Shakespeare.