Ernest Hemingway at a cafe during the San Fermin festival in Pamplona, Spain, in July 1925. Nealry everyone at the table would be portrayed in "The Sun Also Rises" (Ernest Hemingway Collection,/ John F. Kennedy Presidential Library and Museum, Boston)

Gary Krist’s most recent books are “The White Cascade,” “City of Scoundrels,” and “Empire of Sin.”

Even the biggest alpha dog in the pack starts out as a callow young pup. Before Ernest Hemingway became a literary titan, he was a scheming, fame-hungry wannabe who cried over his rejection slips and struggled to pay the rent on a tiny flat above a Parisian sawmill. “It was my ‘complete poverty’ period,” he would later say of these hapless days in the mid-1920s. “I hit everyone for cash. I even borrowed a thousand francs from my barber.” And while he had somehow managed to get two slender collections of short stories published (in “artisanal” editions with a combined total printing of 470 copies), he realized that he’d have to think bigger to make the kind of splash he yearned for. His conclusion: “I knew I must write a novel.”

“Everybody Behaves Badly” is Lesley M.M. Blume’s fiendishly readable account of how that novel — “The Sun Also Rises” — came to be and how it turned Hemingway the obscurity into Hemingway the phenomenon. As literary success stories go, this is hardly unplowed territory. Never mind the groaning shelfload of Hemingway biographies; these early Paris years have also been the subject of numerous memoirs (such as Robert McAlmon’s “Being Geniuses Together” and Hemingway’s own posthumously published “A Moveable Feast”) as well as more broad-spectrum Lost Generation portraits, from James R. Mellow’s “Charmed Circle” to Amanda Vaill’s “Everybody Was So Young.” But Blume’s book is a slightly different animal. It’s a deeply, almost obsessively researched biography of a book, supported by a set of superb endnotes worth reading in their own right. And if that sounds a little dull or esoteric, you clearly haven’t read the novel she’s writing about.

Blume stumbles early on with a breathless introduction that blithely overstates the novel’s historical importance. (“Sun,” she writes, “essentially introduced its mainstream readers to the twentieth century” — in 1926? How had they remained unacquainted for so long?) But she recovers quickly at the start of her main text, conjuring up a vivid picture of Hemingway’s early years in Paris, when the ambitious neophyte cultivated mentors such as Gertrude Stein and Ezra Pound (only to ditch them once their usefulness to him ended). Almost from the beginning, Hemingway knew exactly the kind of innovative fiction he wanted to write — “saturated,” as Blume puts it, “with Pound-inspired spareness and Steinian repetitive stream-of-consciousness elements.” But he also wanted his work to be accessible to a popular audience and thus widely read — a feat that his two exalted mentors had never been able to achieve.

One legacy he took away from his friendship with Stein was a fascination with bullfighting, and it was this that ultimately provided him with the novel-worthy material he needed. In July 1925, he gathered a group of his Parisian cronies and headed down to Pamplona, Spain, for the festival of San Fermin, an annual event that begins with the now-famous running of the bulls and culminates in several days of high-level bullfighting. A visit the previous year had been a great success, but this year’s contingent of hard-drinking sybarites — including an assortment of former and current lovers of a dissolute British aristocrat named Lady Duff Twysden — promised to generate more than a few interpersonal fireworks. And fortunately for Hemingway, his friends delivered the goods, turning the week-long fiesta into a carnival of drunken high jinks, explosive sexual jealousies, maudlin recriminations and enough other bad behavior to fill any number of novels.

To translate this wine-soaked road trip into “The Sun Also Rises,” Hemingway did very little fictionalizing of his raw material. Virtually all of the major characters (despite appearing under invented names) were instantly recognizable to the cognoscenti of Paris, and their various misdeeds were so faithfully reported that one of the book’s real-life models — comic writer Donald Ogden Stewart — refused even to consider it a novel. “It was so absolutely accurate,” he said, “that it seemed little more than a skillfully done travelogue.”

The wider literary world disagreed. Though some writers and critics were unimpressed — John Dos Passos described it as “a cock-and-bull story about a whole lot of tourists getting drunk” — most found the novel stylistically invigorating and sociologically profound. And the fact that the escapades it described were downright scandalous to much of the reading public did nothing to discourage robust sales. Within a few months of publication, there could be no doubt that “Sun” had accomplished its purpose, establishing Hemingway as “the most exciting of contemporary American writers of fiction.”

In recounting this tale of creative struggle and breakthrough, Blume can sometimes devote more attention to the horse race of competitive genius than to the artistic merits of the works and authors she describes. But with her emphasis on gossip and celebrity, she is arguably just following Hemingway’s lead. “He’s the original Limelight Kid,” one of his embittered early publishers once said of him. “Wherever the limelight is, you’ll find Ernest with his big lovable boyish grin, making hay.” Even so, the novel he so opportunistically crafted — for all of its he-man affectations and naked voice-of-a-generation strivings — does hold up remarkably well on rereading. It’s a shame that Hemingway had to humiliate some of his best friends to achieve his long-awaited literary triumph, but the results were probably worth it. As Blume so deftly points out, “After all, he was revolutionizing literature, and in every revolution, some heads must roll.”

Everybody Behaves Badly
The True Story Behind Hemingway’s Masterpiece “The Sun Also Rises”

By Lesley M.M. Blume

Houghton Mifflin Harcourt. 332 pp. $27