For at least a month before his death, Warhol had been ill, but had done his best to keep up his usual exhausting pace. His terror of hospitals had prevented him from getting any serious treatment. Even once Warhol had finally ended up in the office of Bjorn Thorbjarnarson, a leading surgeon — he was known for treating the Shah of Iran — Warhol had begged for some kind of stay-at-home treatment. “I will make you a rich man if you don’t operate on me,” the artist had said, Dr. Thorbjarnarson recalled during my visit to his New Jersey home in 2014. (He is now 95 and lives in Florida.)

Dr. Thorbjarnarson refused Warhol’s entreaties and found himself justified three days later, when the sick man was at last on the operating table at New York Hospital (now NewYork-Presbyterian). The surgeon found a gallbladder full of gangrene; the organ fell to pieces as he removed it, he said.

As Dr. Ryan learned in his research, Warhol was dehydrated and also emaciated from having barely eaten in the previous month; had for years been taking a daily dose of speed; and was still suffering from the effects of a brush with death in 1968, when he was shot by an enraged hanger-on, Valerie Solanas. Only a brilliant surgeon and brilliant luck had saved his life then — he had been declared dead in the emergency room and had nine damaged organs.

Recovery from his gunshot wounds took forever and was never fully complete. He was left with a lifetime of trouble eating and swallowing, as well as a split in his abdominal muscles that gave him a large hernia. (He wore girdles to hold in his bowels.) So in 1987, on top of the tricky gallbladder removal, Dr. Thorbjarnarson would have had no choice but to repair Warhol’s abdominal wall.

The operation seemed to go well, and Warhol was in his room making calls by that evening. He still seemed fine when his private nurse checked on him at 4 a.m. But about two hours later, she found him blue and unresponsive and resuscitation efforts failed. An autopsy concluded that “ventricular fibrillation” was the cause of death, meaning that Warhol’s heart had quivered and stopped.