Vidal died at his home in the Hollywood Hills at about 6:45 p.m. of complications from pneumonia, Burr Steers said. Vidal had been living alone in the home and had been sick for “quite a while,” he 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 play “The Best Man,” revived on Broadway in 2012.

Tall and distinguished looking, with a haughty baritone not unlike that of his conservative arch-enemy William F. Buckley, 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 H.L. 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 honor, 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 to 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.

Vidal would say that his decision to live abroad damaged his literary reputation in the United States. In print and in person, he was a shameless name dropper, but what names! John and Jacqueline Kennedy. Hillary Clinton. Tennessee Williams. Mick Jagger. Orson Welles. Frank Sinatra. Marlon Brando. Paul Newman and Joanne Woodward. Tim Robbins and Susan Sarandon.

Vidal dined with Welles in Los Angeles, lunched with the Kennedys in Florida, clowned with the Newmans in Connecticut, drove wildly around Rome with a nearsighted Williams and escorted Jagger on a sightseeing tour along the Italian coast. He campaigned with Eleanor Roosevelt and Harry Truman. He butted heads, literally, with Mailer. He helped director William Wyler with the script for “Ben-Hur.” He made guest appearances on everything from “The Simpsons” to “Rowan and Martin’s Laugh-In.”

Vidal formed his most unusual bond with Oklahoma City bomber Timothy McVeigh. The two exchanged letters after Vidal’s 1998 article in Vanity Fair on “the shredding” of the Bill of Rights and their friendship inspired Edmund White’s play “Terre Haute.”

Vidal also bewildered his fans by saying the Bush administration likely had advance knowledge of the Sept. 11, 2001 attacks; that McVeigh was no more a killer than Dwight Eisenhower and that the U.S. would eventually be subservient to China, “The Yellow Man’s Burden.”

Christopher Hitchens, who once regarded Vidal as a modern Oscar Wilde, lamented in a 2010 Vanity Fair essay that Vidal’s recent comments suffered from an “utter want of any grace or generosity, as well as the entire absence of any wit or profundity.” Years earlier, Saul Bellow stated that “a dune of salt has grown up to season the preposterous things Gore says.”

A longtime critic of American militarism, Vidal was, ironically, born at the United States Military Academy in West Point, N.Y., his father’s alma mater. Vidal grew up in a political family. His grandfather, Thomas Pryor Gore, was a U.S. senator from Oklahoma. His father, Gene Vidal, served briefly in President Franklin Roosevelt’s administration and was an early expert on aviation. Amelia Earhart was a family friend and reported lover of Gene Vidal.

Vidal was a learned, but primarily self-educated man. Classrooms bored him. He graduated from the elite Phillips Exeter Academy, but then enlisted in the Army and never went to college. His first book, the war novel “Williwaw,” was written while he was in the service and published when he was just 20.

The New York Times’ Orville Prescott praised Vidal as a “canny observer” and “Williwaw” as a “good start toward more substantial accomplishments.” But “The City and the Pillar,” his third book, apparently changed Prescott’s mind. Published in 1948, the novel’s straightforward story about two male lovers was virtually unheard of at the time and Vidal claimed that Prescott swore he would never review his books again. (The critic relented in 1964, calling Vidal’s “Julian” a novel “disgusting enough to sicken many of his readers”). “City and the Pillar” was dedicated to “J.T.,” Jimmie Trimble, a boarding school classmate killed during the war whom Vidal would cite as the great love of his life.

Unable to make a living from fiction, at least when identified as “Gore Vidal,” he wrote a trio of mystery novels in the 1950s under the pen name “Edgar Box” and also wrote fiction as “Katherine Everard” and “Cameron Kay.” He became a playwright, too, writing for the theater and television. The political drama “The Best Man” was later made into a movie, starring Henry Fonda, was revived on Broadway in 2000 and again in 2012. Paul Newman starred in “The Left-Handed Gun,” a film adaptation of Vidal’s “The Death of Billy the Kid.”

Vidal also worked in Hollywood, writing the script for “Suddenly Last Summer” and adding a subtle homoerotic context to “Ben-Hur.” The author himself later appeared in a documentary about gays in Hollywood, “The Celluloid Closet.” His acting credits included “Gattaca,” “With Honors” and Tim Robbins’ political satire, “Bob Roberts.”

Although happy to see and be seen, Vidal saw himself foremost as a man of letters. He wrote a series of acclaimed and provocative historical novels, including “Julian,” “Burr” and “Lincoln.” His 1948 novel “The City and the Pillar” was among the first to feature an openly gay relationship. His 1974 essay on Italo Calvino in The New York Review of Books helped introduce the Italian writer to American audiences. A 1987 essay on Dawn Powell helped restore the then-forgotten author’s reputation and bring her books back in print. Fans welcomed his polished, conversational essays or his annual “State of the Union” reports for the liberal weekly “The Nation.”

He adored the wisdom of Montaigne, the imagination of Calvino, the erudition and insight of Henry James and Edith Wharton. He detested Thomas Pynchon, John Barth and other authors of “teachers’ novels.” He once likened Mailer’s views on women to those of Charles Manson’s. (From this the head-butting incident ensued, backstage at “The Dick Cavett Show.”) He derided Buckley, on television, as a “crypto Nazi.” He called The New York Times the “Typhoid Mary of American journalism,” labeled Ronald Reagan “The Acting President” and identified Reagan’s wife, Nancy, as a social climber “born with a silver ladder in her hand.”

In the 1960s, Vidal increased his involvement in politics. In 1960, he was the Democratic candidate for Congress in an upstate New York district, but was defeated despite Ms. Roosevelt’s active support and a campaign appearance by Truman. (In 1982, Vidal came in second in the California Democratic senatorial primary). In consolation, he noted that he did receive more votes in his district in 1960 than did the man at the top of the Democratic ticket, John F. Kennedy.

Thanks to his friendship with Jacqueline Kennedy, with whom he shared a stepfather, Hugh Auchincloss, he became a supporter and associate of President Kennedy, and wrote a newspaper profile on him soon after his election. With tragic foresight, Vidal called the job of the presidency “literally killing” and worried that “Kennedy may very well not survive.”

Before long, however, he and the Kennedys were estranged, touched off by a personal feud between Vidal and Robert Kennedy apparently sparked by a few too many drinks at a White House party. By 1967, the author was an open critic, portraying the Kennedys as cold and manipulative in the essay “The Holy Family.” Vidal’s politics moved ever to the left and he eventually disdained both major parties as “property” parties _ even as he couldn’t help noting that Hillary Clinton had visited him in Ravello.

Meanwhile, he was again writing fiction. In 1968, he published his most inventive novel, “Myra Breckenridge,” a comic best seller about a transsexual movie star. The year before, with “Washington, D.C.,” Vidal began the cycle of historical works that peaked in 1984 with “Lincoln.”

The novel was not universally praised, with some scholars objecting to Vidal’s unawed portrayal of the president. The author defended his research, including suggestions that the president had syphilis, and called his critics “scholar-squirrels,” more interested in academic status than in serious history. But “Lincoln” stands as his most notable and sympathetic work of historical fiction, vetted and admired by a leading Lincoln biographer, David Herbert Donald, and even cited by the conservative Newt Gingrich as a favorite book. Gingrich’s praise was contrasted by fellow conservative Rep. Michele Bachmann, who alleged she was so put off by Vidal’s “Burr” that she switched party affiliation from Democrat to Republican.

In recent years, Vidal wrote the novel “The Smithsonian Institution” and the nonfiction best sellers “Perpetual War For Perpetual Peace” and “Dreaming War: Blood for Oil and the Cheney-Bush Junta.” A second memoir, “Point to Point Navigation,” came out in 2006. In 2009, “Gore Vidal: Snapshots in History’s Glare” featured pictures of Vidal with Newman, Jagger, Johnny Carson, Jack Nicholson and Bruce Springsteen.

Vidal and Austen chose cemetery plots in Washington, D.C., between Jimmie Trimble and one of Vidal’s literary heroes, Henry Adams. But age and illness did not bring Vidal closer to God. Wheelchair-bound in his 80s and saddened by the death of Austen and many peers and close friends, the impious author still looked to no existence beyond this one.

Vidal is survived by his half-sister Nina Straight and half-brother Tommy Auchincloss.