Correction: An earlier version of this article incorrectly reported Mr. Bradbury’s date of death. He died June 5.

Ray Bradbury, a boundlessly imaginative novelist who wrote some of the most popular science-fiction books of all time, including “Fahrenheit 451” and “The Martian Chronicles,” and who transformed the genre of flying saucers and little green men into literature exploring childhood terrors, colonialism and the erosion of individual thought, died June 5 in Los Angeles. He was 91.

His agent, Michael Congdon, confirmed the death but declined to disclose the cause.

Mr. Bradbury, who began his career in the 1930s contributing stories to pulp-fiction magazines, received a special Pulitzer Prize citation in 2007 “for his distinguished, prolific and deeply influential career as an unmatched author of science fiction and fantasy.”

His body of works, which continued to appear through recent years to terrific reviews, encompassed more than 500 titles, including novels, plays (“Dandelion Wine,” adapted from his 1957 semi-autobiographical novel), children’s books and short stories. His tales were often made into films, including the futuristic story of a book-burning society (director Francois Truffaut’s “Fahrenheit 451” in 1966), a suspense story about childhood fears (“Something Wicked This Way Comes” in 1983) and the more straightforward alien-attack story (“It Came From Outer Space” in 1953).

He helped write filmmaker John Huston’s 1956 movie adaptation of Herman Melville’s novel “Moby-Dick” and contributed scripts to the TV anthology programs “The Twilight Zone” and “Alfred Hitchcock Presents.” Mr. Bradbury hosted his own science-fiction anthology program, “The Ray Bradbury Theater,” from 1985 to 1992 on the HBO and USA cable networks.

“Bradbury took the conventions of the science-fiction genre — time travel, robots, space exploration — and made them signify beyond themselves, giving them a broader and more nuanced emotional appeal to general readers,” said William F. Touponce, a founder and former director of the Center for Ray Bradbury Studies at Indiana University-Purdue University Indianapolis.

“His stories expanded the range of the genre by mixing in with science-fiction themes more traditional elements of romance, together with humor and satire, and even myth and fairy tales, which no doubt contributed to their appeal to a wider audience,” Touponce said.

Having grown up steeped in horror films and pulp magazines such as Amazing Stories, Mr. Bradbury was well-versed in the conventions of science fiction. But the author took those motifs to another level, Touponce said, by using them to comment on broader human themes.

“The Martian Chronicles,” released to wide acclaim in 1950, used the guide of science fiction to explore colonialism, nuclear war and the transformative power of one’s environment.

The book sealed his reputation as a science-fiction writer, but Mr. Bradbury frequently eschewed the label.

“People say, ‘Are you a fantasy writer?’ No,” Mr. Bradbury told the Charlotte Observer in 1997. “ ‘Are you a science-fiction writer?’ No. I’m a magician.”

He explained: “Science fiction is the art of the possible, not the art of the impossible. As soon as you deal with things that can’t happen, you are writing fantasy.”

Mr. Bradbury said “Fahrenheit 451,” based on a novella he called “The Fireman,” was his only work of science fiction.

The 1953 book centers on Guy Montag, a fireman of the future charged with burning books. Montag joins a rogue group seeking to save the great writings of civilization through memorization. Mr. Bradbury said the story was inspired by the Nazi book bonfires of the 1930s that he saw in movie newsreels as a young man.

Many observers linked the anti-book-burning message and that “Fahrenheit 451” was published at a peak moment of Sen. Joseph McCarthy’s (R-Wis.) anti-communist crusade. Mr. Bradbury said “Fahrenheit 451” was not necessarily about top-down censorship.

“The real threat is not from Big Brother, but from little sister [and] all those groups, men and women, who want to impose their views from below,” he told the Times of London in 1993. “If you allow every minority to grab one book off the shelf you’ll have nothing in the library.”

“Fahrenheit 451” continued to spark controversy. It was on the American Library Association’s list of the 100 most-challenged, although not necessarily banned, books of 2000-07. The book’s critics objected to what they considered its inappropriate language and anti-establishment message. It remains, however, a popular selection for schools’ required reading lists and community-wide literary programs.

Ray Douglas Bradbury, who was born Aug. 22, 1920, in Waukegan, Ill., was shaped in many ways by a horrific car wreck he saw as a teenager.

He never learned to drive and grew compulsively wary of the potential dangers of modern mechanized life; he took his first plane trip in 1982, and only then after drinking three double martinis.

He developed a love of books at an early age, with favorite authors including Edgar Allan Poe, Jules Verne and H.G. Wells, and spent many nights at the local library. In a 1985 interview with the Los Angeles Times, he recalled that he was “fairly poor” — his father was a lineman who had trouble finding work — and that he used the scraps of paper provided by the library for reference notes to write down bits of short stories.

He was inspired to write his first story at age 12 by Mr. Electrico, a performer at a traveling carnival. The performer sent an electric current through the boy’s body, proclaiming, “Live forever!,” and later said they’d known each other in one of Mr. Bradbury’s previous lives. The experience evolved into the novel “Something Wicked This Way Comes” (1962), the basis for a film of the same name starring Jonathan Pryce as a diabolical circus owner.

Rejected by the Army during World War II because of poor eyesight, Mr. Bradbury lived with his parents and made money by selling stories to pulp magazines. In 1946, he walked into a bookstore carrying a briefcase and trench coat, and a sales clerk suspected him of being a book thief. The employee was named Marguerite McClure. Mr. Bradbury asked her out for coffee.

“I’m going to the moon some day,” Mr. Bradbury announced. “Wanna come?”

They were married in 1947. Mrs. Bradbury died in 2003. Survivors included four daughters, Susan Nixon, Ramona Ostergren, Bettina Karapetian and Alexandra Bradbury; and eight grandchildren.

Mr. Bradbury’s first book, a short-story collection called “Dark Carnival,” was published in 1947. Many of the stories in the collection, which also introduced the Elliott family of some of his later works, were based on his childhood experiences and fears. He further mined his personal life in a variety of other works, among them “Dandelion Wine,” a snapshot of a small town based on Waukegan.

Accolades began to pile up. Mr. Bradbury received the prestigious O. Henry Award for short stories in 1947 and 1948. His popular breakthrough was “The Martian Chronicles,” which sold a few thousand copies before the paperback edition swept him to the bestseller lists. His next collection of stories, “The Illustrated Man” (1951), hit on the Mars theme as well.

Afraid of being distracted at home by his children, Mr. Bradbury wrote “The Fireman” on a typewriter he rented for 10 cents per half-hour in a basement room at UCLA. He renamed the work “Fahrenheit 451” after phoning a nearby fire department and asking the chief at what temperature book paper burns.

At the time, a critic writing in the New York Times credited Mr. Bradbury with “remarkable virtuosity” and wrote that “Fahrenheit 451” was “moving and convincing at times,” but noted that “the characters remain spare symbols whose imagined lives are curiously inconsistent with established fact.”

Mr. Bradbury gave mixed reviews of the later film adaptation with Oskar Werner and Julie Christie in the lead roles. His early experience writing for Hollywood gave him financial independence for the first time, but he struggled working with the mercurial Huston. A later story, “The Banshee,” was based on their collaboration and centered on a director who torments a young writer with practical jokes and mind games.

Mr. Bradbury continued to publish in the following decades while also working in theater and children’s literature. The story collection “I Sing the Body Electric” appeared in 1969. In something of a departure from his tradition, Mr. Bradbury in 1985 published the novel “Death Is a Lonely Business,” a noir mystery with a protagonist modeled after himself in the late 1940s. He ventured into detective fiction with “Let’s All Kill Constance” in 2003.

He scripted the 1962 animated history of flight, “Icarus Montgolfier Wright,” which received an Academy Award nomination for best short film, and won a Daytime Emmy in 1993 for writing the animated children’s program “The Halloween Tree.” In 2004, President George W. Bush presented Mr. Bradbury with the National Medal of Arts, the nation’s highest award given to artists.

“I can’t name a writer who’s had a more perfect life,” Mr. Bradbury told the New York Times in 1983. “My books are all in print, I’m in all the school libraries, and when I go places I get the applause at the start of my speech.”