Author Jim Harrison in 2008. (Wyatt Mcspadden/Associated Press)

Jim Harrison, the fiction writer, poet, outdoorsman and reveler who wrote with gruff affection for the country’s landscape and rural life and enjoyed mainstream success in middle age with his historical saga “Legends of the Fall,” died March 26 at his home in Patagonia, Ariz. He was 78.

Deb Seager, a spokeswoman for his publisher, Grove Atlantic, confirmed the death. According to Mr. Harrison’s neighbor of 18 years, author and editor Laura Chester, he had been at work in his study, where he “lit an American Spirit and was writing a poem by hand when the sudden and fatal heart attack hit him.”

“A caregiver discovered him when she brought in his dinner,” Chester wrote in an email Monday to the Associated Press.

Mr. Harrison’s wife of more than 50 years, Linda King Harrison, died last fall.

The versatile and prolific author completed more than 30 books, most recently the novella collection “The Ancient Minstrel,” and was admired worldwide. Sometimes likened to Ernest Hemingway for the range and similarities of their interests, Mr. Harrison was a hunter and fisherman who savored his time in a cabin near his Michigan hometown, a drinker and Hollywood scriptwriter who was close friends with Jack Nicholson and came to know Sean Connery, Orson Welles and Warren Beatty, among others. He wrote about sports and was a man of extraordinary appetite who once polished off a 37-course lunch, a traveler and teller of tales, most famously “Legends of the Fall.”

“His voice came from the American heartland and his deep and abiding love of the American landscape runs through his extraordinary body of work,” Grove Atlantic publisher and chief executive Morgan Entrekin said in statement.

Published in 1979, “Legends of the Fall” was a collection of three novellas that featured the title story about Montana rancher Col. William Ludlow and his three sons of sharply contrasting personalities and values. The narrative extended from before World War I to the mid-20th century, from San Francisco to Singapore.

“Late in October 1914 three brothers rode from Choteau, Montana to Calgary, Alberta to enlist in the Great War,” reads Mr. Harrison’s celebrated opening sentence, which author Vance Bourjaily praised for establishing “both the voice and manner of the epic storyteller, who deals in great vistas and vast distances.”

The book was a best seller, and Mr. Harrison worked on the script for an Oscar-winning 1994 film of the same name starring Brad Pitt, Anthony Hopkins and Aidan Quinn. Mr. Harrison’s screenplay credits included “Revenge,” starring Kevin Costner, and the Nicholson film “Wolf.” But he would liken the process of screenwriting to being trapped in a “shuddering elevator” and reminded himself of his marginal status by inscribing a put-down by a Hollywood executive, “You’re just a writer,” on a piece of paper and taping it above his desk.

Mr. Harrison could have been a superb character actor, a bearded, burly man with a disfigured left eye and a smoker’s rasp who confided that when out in public with Nicholson he was sometimes mistaken for the actor’s bodyguard. Erudite enough to write reviews for the New York Times and to quote poet Wallace Stevens from memory, Mr. Harrison also had a strong affinity for physical labor and a history of writing stories for and about men.

“My characters aren’t from the urban dream-coasts,” he told the Paris Review in 1986. “A man is not a foreman on a dam project because he wants to be macho. That’s his job, a job he’s evolved into.”

Mr. Harrison set many works in the rural north of his native Michigan, including the detective novels “The Great Leader” and “The Big Seven,” and used Nebraska as the backdrop for one of his most acclaimed works, “Dalva.”

Other books included a volume of novellas, “The River Swimmer”; the poetry collection “Songs of Unreason”; the novel “Returning to Earth”; and a memoir about food, “The Raw and the Cooked: Adventures of a Roving Gourmand.” He was voted into the American Academy of Arts and Letters in 2007.

He married Linda King in 1959 and had two daughters.

Mr. Harrison was born Dec. 11, 1937, in Grayling, Mich. His father was an agricultural extension agent.

He developed an early love of books and the outdoors. He lost the sight in his left eye at age 7, when a neighbor girl thrust a bottle in his face.

In the 1950s and ’60s, Mr. Harrison drifted between studies at Michigan State University and the “Beat” scene in Boston, where he met Jack Kerouac, and New York City before returning to rural Michigan. In 1965, he debuted as a poet with “Plain Song.”

In the late 1960s, Mr. Harrison slipped off a bank along the Manistee River in Michigan, injured his back, lapsed into a semi-coma and for two years was forced to wear a corset. A close friend, novelist Thomas McGuane, suggested he try a full-length work of fiction.

In 1976, Mr. Harrison visited the set of “The Missouri Breaks,” a 1976 movie written by McGuane, who introduced him to Nicholson.

Mr. Harrison’s first novel, “Wolf,” came out in 1971, followed two years later by “A Good Day to Die.” When his 1976 novel “Farmer” failed to sell well, Mr. Harrison said he was so broke he couldn’t pay his taxes.

His turnaround came after he was visiting his in-laws’ home and came upon the journals of his wife’s great-grandfather, a mining engineer named William Ludlow. Mr. Harrison was inspired to write “Legends of the Fall,” supported by a $15,000 loan from Nicholson.

“And now the one-eyed goofy, the black-sheep poet . . . has inadvertently struck it rich,” Mr. Harrison later wrote of his mid-life success. “After the first full year of this experience I was sitting on the porch of our recently remodeled farmhouse, triple the estimated time and expense and a thoroughly enervating process, reading the Detroit Free Press and noting that I had made more money in the last year than the President of General Motors. . . .

“I idly hoped he was happy in his work.”

— Associated Press