LONDON (AP) — J.P. Donleavy, the incorrigible Irish-American author and playwright whose ribald debut novel “The Ginger Man” met scorn, censorship and eventually celebration as a groundbreaking classic, has died at age 91.

Donleavy, a native New Yorker who lived his final years on an estate west of Dublin, died Monday in Ireland. His death was confirmed by personal assistant Deborah Goss.

The author of more than a dozen books, he sometimes was compared to James Joyce as a prose stylist, but also was admired for his sense of humor. “The Ginger Man,” first published in 1955, sold more than 45 million copies and placed No. 99 on a Modern Library list of the greatest English language fiction of the 20th century.

“The Ginger Man’ has undoubtedly launched thousands of benders, but it has also inspired scores of writers with its vivid and visceral narrative voice and the sheer poetry of its prose,” American novelist Jay McInerney wrote in the introduction for a 2010 reissue.

When the novel was published, authorities targeted its profanity and graphic sexual content. It was banned in Ireland and the United States. Several publishers rejected the book before it was acquired by the Paris-based Olympia Press, which specialized in explicit and avant-garde materials. To Donleavy’s fury, Olympia released the book through an imprint dedicated to pornography.

“The Ginger Man” is an ambling, picaresque tale about the adventures of Sebastian Dangerfield, an American in Dublin after World War II who neglects and abuses his wife and child, mooches off his friends, bilks his landlords, drinks wherever he can run up a tab and rarely lets a woman’s appearance go unnoticed.

“I have discovered one of the great ailments of Ireland, 67 percent of the population has never been completely naked in their lives,” Sebastian observes. “I am bound to say that this must cause a great deal of the passive agony one sees in the street.”

Often cited as prophetic of the cultural revolution of the 1960s, “The Ginger Man” sold so well that it enabled Donleavy to buy Olympia after he and the publisher spent years suing each other over rights to the book.

The author initially had less success adapting “The Ginger Man” for the stage. The play opened in London in 1959 with Richard Harris as Dangerfield, but closed within days in part because of objections from the Roman Catholic Church. A New York production starred Patrick O’Neal, who later opened a Manhattan restaurant and named it after Donleavy’s book.

“The Ginger Man” is also among the most prominent novels never to have been made into a feature film, although those trying included Robert Redford, Mike Nichols and Johnny Depp.

Donleavy, a bearded, green-eyed man who spoke with an Anglicized accent, never lost his affinity for odd and provocative behavior. Cornelius Christian, the protagonist of “A Fairy Tale in New York,” arrives at U.S. Customs with his wife’s body in a box. In “A Singular Man,” the wealthy George Smith composes a will that calls for his estate to be auctioned off and the proceeds “converted to banknotes of small denominations and placed in a steel receptacle six feet high and one foot in diameter.”

Reviewing “A Singular Man” in 1963 for The National Observer, a little known Hunter S. Thompson praised Donleavy as a “humorist in the only sense of the word that has any dignity,” one “forever at war with despair.”

Sebastian Dangerfield was based on a classmate at Trinity College, but Donleavy seemed to share many of his vices, telling The Associated Press in 1992 that at school “I took my degree in drinking and harlotry in the finer pubs of Dublin.”

He was married (and divorced) twice and was nonchalant when interviewers noted that his second wife twice conceived children with other men. He became an Irish citizen in middle age after the government granted artists tax-exempt status.

“Money, above all things,” Donleavy responded when asked by The Paris Review in 1975 about his motivations. “Fame goes, but money never does. It’s got its own beauty. It’s never gone to ashes in my mouth. I’ve always exquisitely enjoyed it. And maybe a little bit of revenge.”

The son of Irish immigrants, James Patrick Donleavy was born in New York City, wrote poetry as a child and had some early success as a painter before turning to fiction in his early 20s. As he explained to The Paris Review, he thought the novel was his quickest path to fame and set out to write a book that would “shake the world.”

Donleavy served in the Navy during World War II, attended Trinity in the late 1940s and began working on “The Ginger Man” soon after. The author would endure a wave of rejections and recalled a visit to the Boston offices of Little, Brown and Company, which had recently published of J.D. Salinger’s “The Catcher In the Rye.”

“The editor called me around there on a hot, sweaty afternoon,” he told The Paris Review. “He sat me a good distance away from his desk, and the manuscript was in a shadowy corner of the room. He leaned back in his chair very nervously and pointed at the manuscript, with his hand trembling, and said, ‘There’s obscene libel in that book!’ So that was the end of Little, Brown.”

Donleavy lived long enough in Ireland to absorb his adopted country’s dark humor about mortality. “When I die,” he once wrote, “I want to decompose in a barrel of porter and have it served in all the pubs in Dublin.” Another time, he composed an epitaph in rhyme:

“When I’m dead, I hope it may be said: his sins were scarlet, but his books were read.”

Jill Lawless contributed to this story.