Gore Vidal, the author, playwright, politician and commentator whose novels, essays, plays and opinions were stamped by his immodest wit and unconventional wisdom, has died in Los Angeles.

Vidal died at his home in the Hollywood Hills at about 6.45pm on Tuesday of complications from pneumonia, his nephew Burr Steers said. Vidal had been living alone in the home and had been sick for "quite a while", Steers said.

Along with such contemporaries as Norman Mailer and Truman Capote, Vidal was among the last generation of literary writers who were also genuine celebrities fixtures on talk shows and in gossip columns, personalities of such size and appeal that even those who hadn't read their books knew who they were.

His works included hundreds of essays; the best-selling novels Lincoln and Myra Breckenridge; the groundbreaking The City and the Pillar, among the first novels about openly gay characters; and the Tony-nominated political drama The Best Man, revived on Broadway in 2012.

Tall and with a haughty baritone not unlike that of his conservative arch-enemy William F Buckley Jr, Vidal appeared cold and cynical on the surface. But he bore a melancholy regard for lost worlds, for the primacy of the written word, for "the ancient American sense that whatever is wrong with human society can be put right by human action".

Vidal was uncomfortable with the literary and political establishment, and the feeling was mutual. Beyond an honorary National Book Award in 2009, he won few major writing prizes, lost both times he ran for office and initially declined membership into the American Academy of Arts and Letters, joking that he already belonged to the Diners Club. He was eventually admitted, in 1999.

But he was widely admired as an independent thinker in the tradition of Mark Twain and HL Mencken about literature, culture, politics and, as he liked to call it, "the birds and the bees". He picked apart politicians, living and dead; mocked religion and prudery; opposed wars from Vietnam to Iraq; and insulted his peers like no other, once observing that the three saddest words in the English language were Joyce Carol Oates. (The happiest words: "I told you so")

The author "meant everything to me when I was learning how to write and learning how to read", Dave Eggers said at the 2009 National Book Awards ceremony, when he and Vidal received honorary citations. "His words, his intellect, his activism, his ability and willingness to always speak up and hold his government accountable, especially, has been so inspiring to me I can't articulate it." Ralph Ellison labeled him a "campy patrician".

Vidal had an old-fashioned belief in honour but a modern will to live as he pleased. He wrote in the memoir Palimpsest that he had more than 1,000 "sexual encounters" – nothing special, he added, compared with the pursuits of such peers as John F Kennedy and Tennessee Williams.

Vidal was fond of drink and alleged that he had sampled every major drug once. He never married and for decades shared a scenic villa in Ravello, Italy, with companion Howard Austen.