It took Beagle "close to two years" to write "The Last Unicorn", and he states that "it was hard every step of the way". Beagle came up with the idea for the novel in 1962 while on an "artistic retreat" in Berkshire Hills after Viking Press rejected his novel "The Mirror Kingdom". He stated that though the idea for the novel was "just suddenly there", he also said that he had "read tons of fantasy and mythology" from childhood, and that his mother told him that he had shared a story about unicorns during a visit to one of the elementary school classes she taught. He also mentioned that he loved the book "The Colt from Moon Mountain" by Dorothy Lathrop (a story about a unicorn in Kansas) as a child, and that Spanish artist Marcial Rodriguez had given him a painting of unicorns fighting bulls when he was seventeen. Once he had the idea, he did research on unicorns at the Pittsfield Library.