When Ray Bradbury, born in 1920, was growing up in Illinois, a traveling carnival came to town. There the young boy watched a kind of magic act performed by Mr. Electro, and afterward hesitantly approached the great wizard himself. Drawing on his mysterious powers, Mr. Electro suddenly anointed Bradbury with his magic sword and dramatically intoned: “Live Forever.”

While Ray Bradbury may have died Tuesday at 91, he will, as readers everywhere mourn his passing, nonetheless live forever. Not only was he one of the greatest of all writers of science fiction and fantasy, he also was one of the most beloved.

View Photo Gallery: The imaginative and prolific author wrote some of the most popular science-fiction books of all time, including "The Martian Chronicles" and "Fahrenheit 451."

A precocious talent, by his early 20s, Bradbury was being published in Weird Tales, Astounding, and Thrilling Wonder Stories, but would soon go on to be one of the first pulp writers to break into slick magazines like Collier’s and The Saturday Evening Post. By his early 30s he had produced such anthology and textbook classics as “The Fog Horn,” “The Small Assassin,” “The Dragon,” “Zero Hour,” “The Veldt,” “The Pedestrian,” “The Next in Line,” and “The Last Night of the World,” as well as “A Sound of Thunder,” the most iconic of modern time-travel tales. That’s the one about the guy who kills a butterfly-like creature back in the age of dinosaurs and when he returns to the present discovers that he has changed history — for the worse, the much, much worse.

Bradbury’s second book, after a collection of macabre stories (“Dark Carnival”), cobbled together a number of short pieces to produce a whole far greater than its parts, “The Martian Chronicles” (1950). In that melancholy classic, successive waves of invaders from Earth gradually wipe out the Red Planet’s ancient and delicate civilization. Bradbury’s prose was correspondingly lyrical and wistful; the book itself unforgettable. In 1953 the industrious young writer, after much difficulty, then managed to expand his novella “The Fireman” into a short novel. As “Fahrenheit 451,” it opens ominously with the famous sentence “It was a pleasure to burn” and stands with Aldous Huxley’s “Brave New World” and George Orwell’s “Nineteen Eighty-Four” as one of our most troubling, visions of a dystopian future. Its hero, Montag, is one of a corps of firemen entrusted with destroying every book in the world. The novel’s now famous title refers to the temperature at which book paper ignites.

In his middle years, Bradbury would produce the script for John Huston’s film of “Moby Dick,” and write such masterpieces of nostalgic fantasy as “Dandelion Wine” and “Something Wicked this Way Comes,” in which a mysterious, threatening carnival arrives in a small midwestern town, as well as the holiday favorite “The Halloween Tree.” In later life, he even turned to writing hardboiled detective novels, the best of them being “Death is a Lonely Business.”

But he always remained, in the hearts of many, America’s greatest science fiction writer, eventually being honored by a special Pulitzer Prize for his lifetime achievement. In truth, though, Bradbury’s fantasy, horror and science fiction did more than merely entertain. In all his work, he explored loneliness and the troubled human heart and our deep-seated fear of otherness. In that regard, he became what he always wanted to be — a great storyteller, sometimes even a mythmaker, a true American classic. Live forever, Mr. Bradbury.

An earlier version of this blog post incorrectly reported Bradbury’s date of death. He died June 5.