The Sandman grew out of a proposal by Neil Gaiman to revive the 1970s Sandman series by Jack Kirby. Gaiman had considered including characters from DC Comics' "Dream Stream" (including the Kirby Sandman, Brute, Glob, and the brothers Cain and Abel) in a scene for the first issue of his 1988 miniseries Black Orchid. While the scene did not make it into later drafts, Gaiman soon began constructing a treatment for a new series. Gaiman mentioned his treatment in passing to DC editor Karen Berger. While months later Berger offered Gaiman a comic title to work on, he was unsure his Sandman pitch would be accepted. However, weeks later Berger asked Gaiman if he was interested in doing a Sandman series. Gaiman recalled, "I said, 'Um...yes. Yes, definitely. What the catch?' [Berger said] 'There's only one. We'd like a new Sandman. Keep the name. But the rest is up to you.'"
Gaiman crafted the new character from an initial image of "a man, young, pale and naked, imprisoned in a tiny cell, waiting until his captors passed away [...] deathly thin, with long dark hair, and strange eyes." Gaiman patterned the character's black attire on a print of a Japanese kimono as well as his own wardrobe. Gaiman wrote an eight-issue outline and gave it to Dave McKean and Leigh Baulch, who drew character sketches. Berger reviewed the sketches (along with some drawn by Gaiman) and suggested Sam Kieth as the series' artist. Mike Dringenberg, Todd Klein, Robbie Busch, and Dave McKean were hired as inker, letterer, colorist, and cover artist, respectively. McKean's approach towards comics covers was unconventional, for he convinced Berger that the series' protagonist did not need to appear on every cover.
The debut issue of The Sandman was cover-dated January 1989. Gaiman described the early issues as "awkward", for he, as well as Kieth, Dringenberg and Busch, had never worked on a regular series before. Kieth quit while working on the third issue; he was replaced by Dringenberg as penciler, who was in turn replaced by Malcolm Jones III as inker.
The Sandman became a cult success for DC Comics and attracted an audience unlike that of mainstream comics: half the readership was female, many were in their twenties, and many read no other comics at all. By the time the series concluded in 1996, it was outselling the titles of DC's flagship character Superman. Gaiman had a finite run in mind for the series, and it concluded with issue 75. Gaiman said in 1996, "Could I do another five issues of Sandman? Well, damn right. And would I be able to look at myself in the mirror happily? No. Is it time to stop because I've reached the end, yes, and I think I'd rather leave while I'm in love."