Faced with a lawsuit, a publisher is withdrawing a novel from sale because it too closely mirrors the autobiography of a living person.

The novel in question is "While England Sleeps," by the prominent young writer David Leavitt. His foe in this case is Sir Stephen Spender, the eminent English poet, whose 1951 memoir "World Within World" recounted a doomed homosexual love affair set against the backdrop of the Spanish Civil War.

Viking, Leavitt's publisher, said yesterday that it would cancel the book not only in Britain, where the suit was filed, but in this country, where the novel is already in bookstores. A U.S. paperback edition scheduled for this fall has also been killed.

The disowning of a newly published novel is extremely unusual. For a writer like the 32-year-old Leavitt, who has often been cast as a spokesman for his generation, it is unprecedented.

Spender sued Leavitt on two grounds: first, that the novel infringed the copyright of "World Within World" by mimicking too closely his relationship with a man he called Jimmy. In both books, the working-class lover leaves to fight in Spain, and the narrator follows him.

The poet also argued that Leavitt's book violated his "moral right" to control how his own material was presented. The latter argument arises out of a new and controversial British copyright law. It is still untested by the courts.

First to discover the similarity between the two books was classics scholar Bernard Knox, whose Sept. 12 review in The Washington Post Book World made a point-by-point comparison.

"Even if I hadn't pointed it out, others would have," Knox said yesterday. He added, "I'm glad it has turned out this way. The novel was in awfully bad taste."

Now that Spender's victory is complete -- as part of the agreement, Viking and Leavitt will pay his court costs -- the poet could afford to be gracious toward the younger writer.

"I don't bear him any ill will," Spender said. "I'm 85 and on the brink of my grave, so I try to be benevolent. The people to criticize are the publishers. They don't seem to have editors who save young writers from making these bad mistakes."

A request for comment left on the answering machine at Leavitt's home in Italy was not returned. A Viking spokesman said Leavitt is rewriting the book as well as composing an introduction detailing what he's learned. The novelist summarized this for an interviewer last fall: "If you're going to write a historical novel, base it on the life of someone who's dead."

Viking, which steadfastly stood by Salman Rushdie and "The Satanic Verses" in the face of innumerable and varied threats, surrendered on Leavitt without going to trial. "The difference is, I was fighting a case based on a fixed point of law -- breach of copyright," said Sam Sylvester, Spender's lawyer.

Martin Garbus, counsel for Viking, said he didn't believe Leavitt's book had violated the copyright law in either Britain or the United States. Nevertheless, the publisher believed it was expedient to settle.

"The whole question of what is and what is not plagiarism is a very sophisticated one," Garbus said. "The law in the United States as well as Britain is in a state of flux. When faced with a case like this, it's intelligent for all sides to resolve it rather than litigate forever."

Sylvester said that not only did the novel's general drift match Spender's account of his life with Jimmy -- which only takes up a handful of pages in the memoir -- but that some of the details did too. "We had a hell of a strong affidavit," he said. "Dozens and dozens and dozens of examples of the takings from our book."

From Spender's book: "We were put into prison at Valencia for a few days. A very dirty cell, very small. ... The food was mainly beans and thin soup, and coffee which tasted like licorice. In the corner a bucket which stank more and more."

From Leavitt: "Well, first they put me in jail in Valencia ... nothing but beans to eat and a bucket in the corner."

Spender, who was sent a copy of the novel by The Post, was outraged, particularly at the explicit sexual acts committed by the hero. "I don't see why {Leavitt} should unload all his sexual fantasies onto me in my youth," said the poet, who is now married.

Leavitt, for his part, told The Post he had wanted to include an acknowledgment to Spender, but had been dissuaded from doing so by the Viking lawyer.

This admission, entered into evidence by the Spender legal team, proved especially damaging. It was, according to Sylvester, tantamount to admitting breach of copyright.

While accusations of plagiarism are relatively common with nonfiction, cases involving novels are not. Recently, two paperback horror novels were found to be heavily plagiarized from works by bestseller Dean Koontz. They were quickly disavowed by the publisher. In 1980, Jacob Epstein's first novel was found to have plagiarized novelist Martin Amis. Both the novel and Epstein quickly disappeared from sight.

That's unlikely to happen to either Leavitt or his ill-fated novel. All 30,000 copies printed since September for the U.S. market have been sent to bookstores, and the unsold ones would normally start coming back now anyway. Viking is not requiring bookstores to return unsold copies.

In fact, news of the settlement may even encourage stores to hold onto them. "I doubt if I will return them," said Deacon Maccubbin of the District bookstore Lambda Rising. "I assume they'll quickly become collectors' items, and people that get them will be happy."

Indeed, Waverley Books, a Los Angeles rare-book dealer specializing in current authors, has listed a signed first edition of "While England Sleeps" in its new catalogue for $100. "Withdrawn by publisher," the catalogue explains.

In Britain, "While England Sleeps" was on the brink of publication when Spender brought his suit. Only a few copies filtered out to stores. The rest are in a warehouse and will presumably be destroyed.

While Leavitt is likely to suffer financially in the short run -- a Viking spokesman said he didn't know how the legal bills were being split between the publisher and the novelist -- it was unclear whether his career would be gravely hurt.

One editor at a major publishing house said yesterday: "Whatever taint there is, I doubt it's filtered down to the general reader. Publishers are likely going to judge his next work the same way they judge everyone else's: by reading it, and by seeing what he's sold before."

However, another editor, who also declined to let his name be used, said: "Literature isn't ice skating, at least not yet. If you pillage someone else's memoir for your source material, it tends to indicate a thinness of literary imagination. Leavitt's aura has been damaged, to state the obvious."

Spender's aura, on the other hand, has certainly been enhanced. The last surviving member of the '30s generation of British poets that included W.H. Auden and C. Day Lewis, he has tended to be more honored than read. "World Within World" has been out of print in this country for more than a decade.

Next fall, however, it will be reissued by St. Martin's Press, along with a collection of poems. The autobiography will include a new introduction about the Leavitt affair, which magazines are already competing to publish.

"It's ironic, isn't it?" Spender said. "My son told me that people are starting to say I engineered this whole thing."