Hoyt Axton, 61, the folksy baritone, songwriter and actor who wrote Three Dog Night's No. 1 hit "Joy to the World" and whose songs were performed by artists from Elvis Presley to Ringo Starr, died Oct. 26 at his ranch in the Bitterroot Valley near Victor, Mont.

He had suffered a severe heart attack two weeks ago and was struck by another while undergoing surgery, said Jan Woods, a longtime friend in Nashville. He had never fully recovered from a 1996 stroke, using a wheelchair much of the time.

He moved to the ranch after playing a sheriff in the movie "Disorganized Crime," filmed there in 1988.

Mr. Axton wrote hits for Starr ("No No Song"), and an array of others, including Presley, Joan Baez, Waylon Jennings, John Denver and Linda Ronstadt. Mr. Axton's singing hits include "Boney Fingers" ("Work your fingers to the bone, what do you get? Boney fingers, boney fingers") and "When the Morning Comes."

Steppenwolf's songs "The Pusher" and "Snowblind Friend" were rare forays into a more serious theme. John Kay, the lead singer of Steppenwolf, recorded "The Pusher" after seeing Mr. Axton perform it at a club in Los Angeles. It was a powerful, passionate song that condemned drug sellers.

And 1975's "No No Song" included the lines "No no no no, I don't sniff it no more. I'm tired of waking up on the floor."

But in 1997, police found slightly more than a pound of marijuana at the home Mr. Axton shared with his wife, Deborah Hawkins. She said she gave her husband marijuana because it relieved some of the pain, anxiety and stress he suffered after his stroke, her lawyer said.

Mr. Axton was given a three-year deferred sentence and fined $15,000 for marijuana possession. Hawkins got a one-year deferred sentence and a $1,000 fine.

Three Dog Night's recording of his novelty "Joy to the World" ("Jeremiah was a bullfrog . . . ") was No. 1 on the charts for six straight weeks in 1971, making it the top hit of the year. Mr. Axton had pitched the song to group members when he was their opening act in 1969-70. He also wrote "Never Been to Spain" for the band, a song that was also recorded by Presley.

A large man, Mr. Axton specialized in playing good ol' boys on television and in film. He appeared in many movies and television shows, including "Gremlins" and "The Black Stallion." He sang the "Head to the Mountains" jingle used to advertise Busch beer in the 1980s.

Born in Duncan, Okla., he began singing folk songs in the clubs of San Francisco in 1958. A song he co-wrote, "Greenback Dollar," was a 1963 hit for the Kingston Trio.

Mr. Axton's mother, Mae Boren Axton, had her own spot in popular culture history as the songwriter of Presley's "Heartbreak Hotel."

In addition to his wife, survivors include five children.

CAPTION: Hoyt Axton wrote the hit "Joy to the World" and appeared in "Gremlins."