The City and the Pillar is the third published novel by American writer Gore Vidal, written in 1946 and published on January 10, 1948.  The story is about a young man who is coming of age and discovers his own homosexuality.
 The City and the Pillar is significant because it is recognized as the first post-World War II novel whose gay protagonist is portrayed in a sympathetic manner and is not killed off at the end of the story for defying social norms.  It is also recognized as one of the "definitive war-influenced gay novels", being one of the few books of its period dealing directly with male homosexuality.  In addition, it was among the few gay novels reprinted in inexpensive paperback form as early as the 1950s.
 In 1965, Vidal released an updated version of the novel titled The City and the Pillar Revised.  Most modern printings contain the updated text; however, they retain the original title The City and the Pillar.
 The plot centers on Jim Willard, a handsome youth in Virginia in the late 1930s, who is also a very good tennis player. When his best friend Bob Ford, one year his senior, is about to leave high school, the two take a camping trip into the woods. Both are elated to be in each other's company and, after some moaning from Bob about how difficult it is to get the local girls to have sex with him, the two have sex, even though Bob thinks this is not a "normal" thing for two men to do.
 Jim, who does not find girls so appealing, hopes Bob can stay and is crushed when Bob is insistent on joining the United States Merchant Marine. The next seven years of Jim's life will be an odyssey, at the end of which he hopes to be happily reunited with Bob.
 Jim decides he wants to go to sea too and becomes a cabin boy on a cruise ship after going to New York City to look for work. Another seaman on his ship, Collins, goes out with him in Seattle, but is more interested in a double date with two girls than in sex with Jim. The date is a disaster for Jim, who must realize that he is unable to drink enough to overcome being repelled by the female body. When he finally storms out, Collins calls him a queer, which causes him to think about this possibility.
 He quits his job, fearing another confrontation with Collins, and becomes a tennis instructor at a hotel in Los Angeles. One of the bellboys, Leaper, whose advances he has spurned previously, introduces him to the circle around the mid-thirties Hollywood actor Ronald Shaw, who immediately takes interest in Jim. Eventually, Jim moves in with Ronald, even though he is not really in love with him.
 Their affair is ended when Jim meets the writer Paul Sullivan, who is in his late twenties, at a party. Jim is drawn to Paul because he seems so different from the other, more stereotypical homosexuals he meets at Hollywood parties, even having married once (although that marriage was later annulled).
 When Ronald learns of their relationship, Jim is quite happy to move with Paul to New Orleans. Again, he is not in love with Paul but with his boyhood pal, but he considers Paul adequate for the time being. Paul however, needing some pain in his relationships for artistic inspiration, introduces Jim to Maria Verlaine, who seems to specialize in seducing homosexuals, hoping his relationship will end in a suitably tragic way. Together, the three go to Yucatán, where Maria has made an inheritance. Jim does feel vaguely attracted to Maria, but he is unable to perform sexually. All the same, for Paul even an imagined affair of his boyfriend with a woman is as painful as he had hoped and warrants a breakup.
 In the meantime, World War II has started in Europe and Paul and Jim are determined to go to New York to enlist in the Army. This of course also means their separation. Jim gets transferred to a Colorado Air Force base, where his sergeant is clearly sexually interested in him. But Jim has set his sights on a young corporal. Unfortunately, the corporal does not seem to like him in "that" way, even though the sergeant later seems to succeed with the corporal.
 Due to the cold Colorado weather, Jim contracts rheumatoid arthritis and is eventually discharged from service. He goes back to New York, where he meets Maria and Ronald again. Ronald has been forced to marry a lesbian by studio executives to uphold his public image and tries unsuccessfully to become a stage actor. He also introduces Jim to his local friends like an effeminate millionaire. Jim begins frequenting gay bars to find sexual relief. Later, he meets Paul at a party and the two start an open relationship, not because of passion, but out of loneliness.
 When Jim finally goes home for Christmas, he learns that his father is dead and (more alarming to him) that Bob has married. Hoping their affair can resume despite this, Jim is anxious to see him again.
 The resolution of their relationship comes again in New York, where they end up on the bed in Bob's hotel room. But when Jim finally thinks he has attained what he wants and moves closer, grabbing his "sex", Bob panics, is outraged to be thought of as gay, and even punches Jim in the face. The two struggle and Jim wins because he is stronger. In the original version, Jim is infuriated enough to murder Bob while in the revision he rapes Bob and then leaves the room.
 The major theme of the novel is how prejudice creates the object of its own hatred, and in the process damages not only the oppressed, but also society at large. The protagonist is a potentially well adjusted individual who is forced, by society's neurotic attitude to sex in general and to sex between men in particular, into a pattern of behaviors that precludes happiness or fulfillment, and eventually leads to a destructive denouement. The origin of society's perverse attitude to sex is subtly traced to religion (both by the epigraph opening the novel, which is the end of the biblical passage describing the destruction of Sodom, and by remarks scattered in the narrative by different characters, who voice Vidal's idea that humans are naturally bisexual, and this natural inclination is perverted by cultural superstructures).
 Another theme is the portrayal of the homosexual man as masculine.  Vidal set out to break the mould of novels that up until The City and the Pillar depicted homosexuals as transvestites, lonely bookish boys, or feminine.  Vidal purposefully makes his protagonist a strong athlete to challenge superstitions, stereotypes, and prejudices about sex in the United States.  To further this theme Vidal wrote the novel in plain, objective prose in order to convey and document reality.
 Two additional themes identified by Dennis Bolin are the foolishness and destructiveness of wishing for something that can never be and to waste one's life dwelling on the past, the second of which is reinforced by the novel's epigraph from the Book of Genesis 19:26 "But his wife looked back from behind him and she became a pillar of salt."
 The City and the Pillar sparked a public scandal, including notoriety and criticism, not only since it was released at a time when homosexuality was commonly considered immoral, but also because it was the first book by an accepted American author to portray overt homosexuality as a natural behavior.  The controversial reception began before the novel hit bookshelves.  Prior to its even being published, an editor at EP Dutton said to Vidal, "You will never be forgiven for this book.  Twenty years from now you will still be attacked for it."  Looking back in retrospect from 2009, it is considered by Ian Young to be "perhaps the most notorious of the gay novels of the 1940s and 1950s."
 Vidal himself said "shock was the most pleasant emotion aroused in the press."  Upon its release the New York Times would not advertise the novel.  Vidal was blacklisted after releasing The City and the Pillar to the extent that no major newspaper or magazine would review any of his novels for six years.  This forced Vidal to write several subsequent books under pseudonyms.  Subsequently, he reestablished a popular reputation and resumed using his true name.
 At the time, Christopher Isherwood privately responded to the novel enthusiastically, whereas Thomas Mann, another contemporary writer, privately responded with short politeness.  Stephen Spender expressed the notion that the novel was plainly autobiographical and a sexual confession on Vidal's part; this has been denied by Vidal.
 Modern scholars note the importance of the novel to the visibility of gay literature.  Michael Bronski points out that "gay-male-themed books received greater critical attention than lesbian ones" and that "writers such as Gore Vidal were accepted as important American writers, even when they received attacks from homophobic critics."  Bronski also suggests that the mantle of "literary quality" conferred some level of protection from censorship upon the works.  Ian Young notes that social disruptions of World War II changed public morals and enumerates The City and the Pillar among a spate of war novels that use the military as backdrop for overt homosexual behavior.  The book has, however, faced criticism from some contemporary gay theorists, who consider the novel's emphasis on masculinity and its explicit put-downs of effeminate and gender-deviant gay men to be heteronormative.
 The book sold well, enjoying several paperback reprint editions; the 1950 Signet edition features a cover painting by the notable artist James Avati.  The City and the Pillar is considered by Anthony Slide to be one of only four familiar gay novels of the first half of the twentieth century in English.  The other three novels are Djuna Barnes' Nightwood, Carson McCullers' Reflections in a Golden Eye, and Truman Capote's Other Voices, Other Rooms.  The City and the Pillar was ranked number 17 on a list of the best 100 gay and lesbian novels compiled by The Publishing Triangle in 1999.
 In 1965, E.P. Dutton published Vidal's updated version of The City and the Pillar, titled The City and the Pillar Revised.
 In this version, Vidal removed melodramatic narrative, passages of introspection, and politically offensive language and strove to clarify the intended theme of the work.  The original edition was divided into two sections: "The City" and "The Pillar"; in the revised edition the narrative is continuous.  Vidal also significantly changed the storyline in the coda so that Jim rapes Bob instead of murdering him.  It is commonly believed that the publishers of The City and the Pillar (in its original form) coerced Gore to give the original a cautionary ending, but Gore specifically denied this.
 Vidal said in a 2006 NPR interview that parts of the dynamic of The City and the Pillar were softened for the public and applied to the script for Ben-Hur which Vidal and others were called in to re-work.[citation needed]
 In the 2022 homoerotic film Dino at the Beach which takes place in the 1960s, the main character is reading a 1950s paperback printing of the novel. The placement of the book contributes largely to the themes of discovering one's own homosexuality in the film.