E. L. Doctorow, a leading figure in contemporary American letters whose popular, critically admired and award-winning novels — including "Ragtime," "Billy Bathgate" and "The March" — situated fictional characters in recognizable historical contexts, among identifiable historical figures and often within unconventional narrative forms, died on Tuesday in Manhattan. He was 84 and had homes in Manhattan and Sag Harbor, N.Y.

The cause was complications from lung cancer, his son, Richard, said.

The author of a dozen novels, three volumes of short fiction and a stage drama, as well as essays and commentary on literature and politics, Mr. Doctorow was widely lauded for the originality, versatility and audacity of his imagination.

Subtly subversive in his fiction — less so in his left-wing political writing — he consistently upended expectations with a cocktail of fiction and fact, remixed in book after book; with clever and substantive manipulations of popular genres like the Western and the detective story, and with his myriad storytelling strategies. Deploying, in different books, the unreliable narrator, the stream-of-consciousness narrator, the omniscient narrator and multiple narrators, Mr. Doctorow was one of contemporary fiction's most restless experimenters.

In "World's Fair" (1985), for example, a book that hews closely to Mr. Doctorow's autobiography and that the author once described as "a portrait of the artist as a very young boy" (but also as "the illusion of a memoir"), he depicts the experience of a Depression-era child of the Bronx and his awakening to the ideas of America and of a complicated world. Ending at the 1939 World's Fair in New York, the book tilts irresistibly toward the technological future of the country and the artistic future of the man.

The narrator is the man looking back on his childhood, but the conventionality of the narration is undermined in two ways. For one thing, the man's relatives get their own first-person chapters and inject their own memories, a strategy that adds depth and luster to the portrait of the time and place. For another, the man's own narration is offered in the present tense, as if the preadolescent character were telling an unfolding tale, though with the perspective and vocabulary of an adult. His opening recollection — or is it a contemporaneous report? — is of wetting the bed:

"Startled awake by the ammoniated mists, I am roused in one instant from glutinous sleep to grieving awareness; I have done it again. My soaked thighs sting. I cry. I call Mama, knowing I must endure her harsh reaction, get through that, to be rescued. My crib is on the east wall of their room. Their bed is on the south wall. 'Mama!' From her bed she hushes me."

Beginning with his third novel, "The Book of Daniel" (1971), an ostensible memoir by the son of infamous accused traitors — their story mirrors that of Julius and Ethel Rosenberg, who were executed as Russian spies in 1953 — Mr. Doctorow turned out a stream of literary inventions. His protagonists lived in the seeming thrall of history but their tales, for the convenience — or, better, the purpose — of fiction, depicted alterations in accepted versions of the past. Not that he undermined the grand scheme of things; his interest was not of the what-if-things-had-gone-differently variety. Rather, a good part of Mr. Doctorow's achievement was in illustrating how the past informs the present, and how the present has evolved from the past.

In the book that made him famous, "Ragtime" (1975), set in and around New York as America hurtled toward involvement in World War I, the war arrives on schedule, but the actions of the many characters, both fictional and nonfictional (including the escape artist Harry Houdini, the anarchist philosopher Emma Goldman and the novelist Theodore Dreiser) were largely invented. Sometimes this was for droll effect — at one point Freud and Jung, visiting New York at the same time, take an amusement park boat ride together through the tunnel of love — and sometimes for the sake of narrative drama and thematic impact. Written in a declarative, confident voice with an often dryly arch tone mocking its presumed omniscience, the novel seemed to both lay claim to authoritative historical perspective and undermine it with winking commentary.

Houdini, Mr. Doctorow writes, "was passionately in love with his ancient mother whom he had installed in his brownstone home on West 113th Street."

"In fact," he continues, "Sigmund Freud had just arrived in America to give a series of lectures at Clark University in Worcester, Massachusetts, and so Houdini was destined to be, with Al Jolson, the last of the great shameless mother lovers, a nineteenth-century movement that included such men as Poe, John Brown, Lincoln and James McNeill Whistler. Of course Freud's immediate reception in America was not auspicious. A few professional alienists understood his importance, but to most of the public he appeared as some kind of German sexologist, an exponent of free love who used big words to talk about dirty things. At least a decade would have to pass before Freud would have his revenge and see his ideas begin to destroy sex in America forever."

Woven into the rollicking narrative of "Ragtime" are the dawn of the movies and the roots of the American labor movement, tabloid journalism and women's rights. The central plot involves the violent retribution taken by a black musician against a society that has left him without redress for his heinous victimization. The events described never took place (Mr. Doctorow borrowed the plot from a 19th-century novel by the German writer Heinrich von Kleist, who based his tale on a 16th-century news event), but they contribute to Mr. Doctorow's foreshadowing of racial conflict as one the great cultural themes of 20th-century American life.

In "Billy Bathgate," a Depression-era Bronx teenager is seduced by the pleasures of lawlessness when he is engaged as an errand boy by the gangster Dutch Schultz, who is about to go on trial for tax evasion; it is not an allegory but, published in 1989, as the "greed is good" decade of the 1980s came to a close, the novel makes plain that Schultz's corrupt entrepreneurism is of a piece with the avaricious manipulations of white-collar financiers, forerunners of a Wall Street run amok.

"The distinguished characteristic of E. L. Doctorow's work is its double vision," the critic Peter S. Prescott wrote in Newsweek in 1984. "In each of his books he experiments with the forms of fiction, working for effects that others haven't already achieved; in each he develops a tone, a structure and a texture that he hasn't used before. At the same time, he's a deeply traditional writer, reworking American history, American literary archetypes, even exhausted subliterary genres. It's an astonishing performance, really."

Most of Mr. Doctorow's historical explorations involved New York and its environs, including "Loon Lake" (1980), the tale of a 1930s drifter who comes upon a kind of otherworldly kingdom, a private retreat in the Adirondacks; "Lives of the Poets" (1984), a novella and six stories that collectively depict the mind of a writer who has, during the 1970s, succumbed to midlife ennui; and "The Waterworks" (1994), a dark mystery set in Manhattan in the 1870s, involving a journalist who vanishes and an evil scientist.

More recently, in "City of God" (2000), Mr. Doctorow wrote about three characters — a writer, a rabbi and a priest — and the search for faith in a cacophonous and especially hazardous age, using contemporary Manhattan as a backdrop. And in "Homer and Langley" (2009), he created a tour of 20th-century history from the perspective of a blind man, Homer Collyer, a highly fictionalized rendering of one of two eccentric brothers living on upper Fifth Avenue who became notorious after their deaths for their obsessive hoarding.

Indeed, much of his oeuvre describes a fictional history, more or less, of 20th-century America in general and New York in particular.

"Someone said to me once that my books can be arranged in rough chronological order to indicate one man's sense of 120 years of American life," Mr. Doctorow said on the publication of "City of God." "In this book, it seems I've finally caught up to the present."

"The March" (2005) was Mr. Doctorow's furthest reach back into history, and it expanded his geographical reach as well, populating the destructive and decisive Civil War campaign of General William T. Sherman — the capture of Atlanta and the so-called march to the sea — with a plethora of characters. Black and white, wealthy and wanting, military and civilian, sympathetic and repugnant, they describe a veritable representation of the American people.

Winner of the Pen/Faulkner Award for Fiction (also won by "Billy Bathgate") and the National Book Critics Circle Award for fiction (also won by "Ragtime" and "Billy Bathgate"), a finalist for the National Book Award (won by "World's Fair") and the Pulitzer Prize, "The March" was widely recognized as a signature book, treated by critics as the climactic work of a career.

Perhaps the most telling review came from John Updike, who was prominent among a noisy minority of critics who generally found Mr. Doctorow's tinkering with history misleading if not an outright violation of the tenets of narrative literature. Updike held "Ragtime" in especial disdain.

"It smacked of playing with helpless dead puppets, and turned the historical novel into a gravity-free, faintly sadistic game," he wrote in The New Yorker, going on to dismiss several other Doctorow books before granting their author a reprieve.

"His splendid new novel, 'The March,' pretty well cures my Doctorow problem," Updike wrote, adding, "The novel shares with 'Ragtime' a texture of terse episodes and dialogue shorn, in avant-garde fashion, of quotation marks, but has little of the older book's distancing jazz, its impudent, mocking shuffle of facts; it celebrates its epic war with the stirring music of a brass marching band heard from afar, then loud and up close, and finally receding over the horizon.

"Reading historical fiction," Updike went on, "we often itch, our curiosity piqued, to consult a book of straight history, to get to the facts without the fiction. But 'The March' stimulates little such itch; it offers an illumination, fitful and flickering, of a historic upheaval that only fiction could provide. Doctorow here appears not so much a reconstructor of history as a visionary who seeks in time past occasions for poetry."

Learning the Power of Fiction

Edgar Lawrence Doctorow was born in the Bronx on Jan. 6, 1931. His grandparents were Jewish immigrants from Russia. His father, David, had a store that sold musical instruments in the old Hippodrome building in midtown Manhattan; his mother, Rose, played the piano.

Though the family struggled for money, young Edgar had a childhood he later described as pleasant, with stoop ball games in the street, summers at camp, frequent trips to the theater and the Museum of Modern Art and a general immersion in the perfervid atmosphere of intellect and culture that distinguished New York City even more than than it does today.

"As a boy I went matter of factly to plays, to concerts," he recalled in a mid-1990s interview with The Kenyon Review. "And as I grew up I was a beneficiary of the incredible energies of European émigrés in every field — all those great minds hounded out of Europe by Hitler. They brought enormous sophistication to literary criticism, philosophy, science, music. I was very lucky to be a New Yorker."

His family was a family of readers; he was named for Edgar Allan Poe, a favorite of his father's.

"Actually, he liked a lot of bad writers, but Poe was our greatest bad writer, so I take some consolation from that," Mr. Doctorow said in 2008. "He died many years ago. My mother lived into her 90s, and I remember asking her in her old age — I finally dealt with the question of my name — "Do you and Dad know you named me after a drug-addicted, alcoholic delusional paranoid with strong necrophiliac tendencies?' and she said, 'Edgar, that's not funny.' "

Young Edgar learned the persuasive power of fiction at an early age. In a story he often told, in the late 1940s, he fulfilled an assignment in a journalism class at the Bronx High School of Science by writing a profile of Carl, the stage doorman at Carnegie Hall, filling it with such persuasive and poignant details that his teacher wanted to run it in the school newspaper. When it was time for a photographer to take the man's picture, however, Edgar had to confess that there was no Carl the doorman; Carl was an invention.

Mr. Doctorow studied with the poet and critic John Crowe Ransom at Kenyon College in Ohio, where he earned a bachelor's degree, then spent a year in the graduate program in drama at Columbia, where he met his wife, Helen Setzer, then an aspiring actress. (She later published a novel, "Pretty Redwing", under the name Helen Henslee.) They married in Germany while Mr. Doctorow, who had been drafted, was in the Army. In addition to his wife and son, Mr. Doctorow is survived by two daughters, Jenny Doctorow Fe-Bornstein and Caroline Doctorow Gatewood, and four grandchildren.

After his discharge, he worked odd jobs while trying to write; for a time he was a reservations clerk at La Guardia Airport, later a script reader for CBS Television and Columbia Pictures, jobs that fed his writer's imagination and competitive spirit. His first novel, "Welcome to Hard Times" (1960), was a western fable, both violent and darkly comic, a sendup of the dreadful genre scripts he'd been immersed in.

His second book, "Big As Life" (1966), was also drawn from genre fiction. A peculiar fantasy — science fiction, sort of — the novel is about New Yorkers who are thrown together one morning when, without explanation, two human giants are found standing, seemingly immobile, in the lower Hudson River. An unsuccessful book — "Unquestionably it's the worst I've done," Mr. Doctorow said in 1980, and would have no reason to change his mind later — it remains his only novel no longer in print.

By then Mr. Doctorow had become a significant personage in the publishing industry. In the late 1950s, he had started as an editor at New American Library and within a few years had moved to Dial Press, where he was editor in chief, working with Norman Mailer, James Baldwin and others. Toward the end of his tenure he was the publisher as well. He left the job in 1969 to concentrate on the book he was then struggling with, a reimagining of the Rosenberg case that became "The Book of Daniel," a novel the critic Stanley Kauffmann, writing in Saturday Review, called "the best American political novel in a generation."

Soft-spoken, wry, and a bit professorial in demeanor — he taught at Sarah Lawrence College and New York University, among other places — Mr. Doctorow was nonetheless capable of stinging verbal rhetoric, particularly in the service of political protest. In 2004, his address to graduating seniors at Hofstra University, in which he criticized President George W. Bush for his "storytelling" in the run-up to the invasion of Iraq, drew boos from the audience and a harsh retort from the columnist Peggy Noonan in The Wall Street Journal, who cited "the boorishness of the aging liberal" and called him Fast Eddy (oddly enough the same moniker used by a tennis partner, the novelist Avery Corman, who admired Mr. Doctorow's quickness at the net.)

Mr. Doctorow's progressive views (he described himself as "a leftist, but of the pragmatic social democratic left — the humanist left that's wary of ideological fervor") were often apparent in his fiction. His depiction, for example, of scabrous capitalists in "Ragtime" or his central figure's decisive act of political engagement in "Lives of the Poets" (he houses a family of illegal immigrants from El Salvador in his Greenwich Village apartment) led to his being characterized as a political novelist as often as he was called a historical novelist, though he rejected any such characterization.

Several of Mr. Doctorow's novels were adapted for the screen, including "Welcome to Hard Times," a film, starring Henry Fonda, that Mr. Doctorow (and most critics) assessed as dreadful. Better films were made of "The Book of Daniel" (it was called, simply, "Daniel," and starred Timothy Hutton), "Ragtime" (directed by Milos Forman, featuring James Cagney in his final appearance in a feature film) and "Billy Bathgate," starring Dustin Hoffman as Dutch Schultz. His short story "Jolene: A Life," tracing the picaresque travels of a teenage orphan girl, was made into a 2008 film that introduced the actress Jessica Chastain. Mr. Doctorow himself played a small role — as an adviser to President Grover Cleveland — in Robert Altman's 1976 archly comic historical film, "Buffalo Bill and the Indians."

The most prominent adaptation of Mr. Doctorow's work, however, was for the stage. In 1996, "Ragtime: the Musical" opened in Toronto as the foundation of the theatrical empire planned by the Canadian impresario Garth Drabinsky. Though the show also ran for two years on Broadway, winning four Tony Awards, and several other productions were put on in other American cities and internationally, it failed to be the megahit that Mr. Drabinsky gambled it would be.

By 1998, Mr. Drabinsky's company, Livent, was mired in debt; he and a partner, Myron Gottlieb, were ousted by the board, and the men were subsequently indicted in the United States for misappropriating company funds. A less lavish revival of "Ragtime" appeared on Broadway in 2009.

Mr. Doctorow's own play, "Drinks Before Dinner," about a party of urbane New Yorkers that is hijacked by an existentially outraged guest with a gun, was directed by Mike Nichols and starred Christopher Plummer when it was first performed, in 1978 at the Public Theater in Manhattan.

His final novel, "Andrew's Brain" (2014), was written as a confessional monologue by a brilliant and deluded cognitive scientist whose gift for dissembling is attributed to the nature of the mind and the impossibility of burrowing to the truth with the tools of thought and speech.

"Pretending is the brain's work," Andrew explains. "It's what it does."

In Andrew, Mr. Doctorow created perhaps his most inscrutable character — a narrator who recognizes the futility of narration.

Mr. Doctorow could be inscrutable himself. In writing a novel, he once said, it was his technique to stand at a remove, to invent a voice and let the voice speak, "to create the artist and let the artist do the work."

"The image I like is the one from cartoons," he added in an interview in The New York Times Magazine in 1985. "You see the artist's hand drawing a little mouse. It colors in the jacket and the pants, and then it gives him a little goose, and the mouse scoots away down the road.

"Well," he said, "the hand is drawn, too."