"Written during the first part of the seventeenth century (probably in 1600 or 1601), 'Hamlet' was probably first performed in July 1602. It was first published in printed form in 1603 and appeared in an enlarged edition in 1604. As was common practice during the sixteenth and seventeenth centuries, Shakespeare borrowed for his plays ideas and stories from earlier literary works. He could have taken the story of Hamlet from several possible sources, including a twelfth-century Latin history of Denmark compiled by Saxo Grammaticus and a prose work by the French writer François de Belleforest, entitled 'Histoires Tragiques.'" -- "Hamlet," SparkNotes.com