A 1935 letter in which Ernest Hemingway details his capture of a 500lb blue marlin, an escapade that is believed to have partly inspired his novel The Old Man and the Sea, has been sold for $28,000 (£22,000).

The handwritten letter was sent by Hemingway on 8 May to the fishing editor of the Miami Herald, laying out in great detail how the author and his friend Henry Strater battled to keep sharks away from the marlin after catching it off the Bahamian island of Bimini.

“Landed Blue Marlin which weighed 500 lbs [226kg] … Fish hooked off Bimini, hooked in corner of mouth … jumped 18 times clear, brought to boat in an hour such a heavy fish jumped hell out of himself. We worked him fast our system. Had him at boat when shark hit him,” wrote the novelist, who would go on to recount the story of the ageing Cuban fisherman Santiago’s battle with a gigantic marlin in The Old Man and the Sea.

Hemingway’s two-page letter to the editor, with a photograph of the 1935 marlin. Photograph: Nate D Saunders Auction House

In his letter, Hemingway recalls how the sharks bit so much meat off the marlin that it would have weighed between 700 and 900lbs if it had been reeled in intact. “Had two buckets full of meat that knocked off but wouldn’t weigh it as didn’t want try to beat Tommys record with any conniving,” he writes (referring to the angler Tommy Gifford’s 800lb record), and promising to measure the fish with a steel tape when he had the chance. “Fish would have weighed between 700 and 900 – He weighed 500 before 20 some witnesses. We could have brought him plenty up above that by weighing the loose meat.”

Nate D Sanders, which sold the letter at auction, said it documented for the first time in Hemingway’s own words not only the size of the marlin, but also the attack by sharks, reflecting the plot of the novel.

The company added that Hemingway’s account of the marlin catch differed from other anecdotal stories of it, one of which described Hemingway using a machine gun on the shark, which purportedly attracted more sharks to the feeding frenzy. “It’s likely Hemingway left out this detail, as Strater would blame its use on attracting more sharks to the marlin” – thus depriving him of a world record marlin catch. The Old Man and the Sea has been said by Hemingway scholars to have probably been inspired by the fishing trip, on 7 May 1935.

The novel was also inspired by an anecdote told by Hemingway’s Cuban friend Carlos Gutierrez. In the April 1936 issue of Esquire, Hemingway wrote that Carlos had told him about “an old man fishing alone in a skiff out of Cabanas”, who “hooked a great marlin that, on the heavy sashcord hand-line, pulled the skiff out to the sea”.

“Two days later the old man was picked up by fisherman 60 miles to the eastward, the head and forward part of the marlin lashed alongside. What was left of the fish, less than half, weighed 800 pounds,” wrote Hemingway. “The old man had stayed with him a day, a night, a day and another night while the fish swam deep and pulled the boat. When he had come up, the old man had pulled the boat up on him and harpooned him. Lashed alongside the sharks had hit him and the old man had fought them out alone in the Gulf stream in a skiff, clubbing them, stabbing at them, lunging at them with an oar until he was exhausted and the sharks had eaten all that they could hold. He was crying in the boat when the fishermen picked him up, half crazy from his loss, and the sharks were still circling the boat.”

Three years later, Hemingway told his editor Max Perkins that he was planning a new book of short stories, “one about the old commercial fisherman who fought the swordfish all alone in his skiff … I’m going out with old Carlos in his skiff so as to get it all right.” Instead, he ended up writing For Whom the Bell Tolls, not returning to what he called the “Santiago story” until January 1951. It won him the Pulitzer in 1953, and was specifically cited when he was awarded the Nobel prize in 1954.