Mr. Carawan, shown in 2009 at his home in New Market, Tenn., died at 87. (Photo by Dan MacDonald)

The tempo marking for “We Shall Overcome” reads “moderately slow with determination.” Slowly but with determination — and with help from folk musician Guy Carawan — is how that song was transformed from age-old spiritual to labor protest music to the anthem of the civil rights movement.

Mr. Carawan, who died May 2 at 87, served for decades as a leader of what is now the Highlander Research and Education Center in New Market, Tenn., a gathering place for social-justice activists whose visitors over the years included Rosa Parks and the Rev. Martin Luther King Jr.

Often traveling with a bulky recorder, Mr. Carawan spent much of his life collecting and preserving folk songs so that they would not be lost in the rush of time. “We Shall Overcome,” with its promise of deliverance over struggle, was only one of those numbers. But few, if any, others matched its enduring resonance.

Accounts of the song’s history trace its origins to “I’ll Be All Right Someday,” a spiritual sung by slaves in the American South. With modifications by Charles Albert Tindley, a minister whose life spanned the end of the 19th century and the beginning of the 20th, the song grew in popularity as the church hymn “I’ll Overcome Someday.”

In later years, labor activists — most prominently a group of striking cigar factory workers in Charleston, S.C., in the mid-1940s — adopted the song for their cause. They were credited with evoking solidarity by changing the singular “I” to the plural “we,” proclaiming, “We will overcome, and we will win our rights someday.”

Labor workers were said to have taught the song to Zilphia Horton, the musician and social-justice activist who preceded Mr. Carawan as music director of the Highlander Folk School, as it was then known.

She was credited with singing it for Pete Seeger, the folk troubadour who popularized tunes such as “If I Had a Hammer” and “This Land Is Your Land,” along with “We Shall Overcome.” In his version of the song, Seeger preferred the verb “shall” instead of “will,” he said, because it “opens up the mouth better.”

A turning point in the song’s history came in 1950, when Seeger recalled that he taught it to Mr. Carawan. Mr. Carawan joined the Highlander center later that decade and sang it for civil-rights activists who met there. They, in turn, sang it at protests and in prison.

In 1960, Mr. Carawan performed it in Raleigh, N.C., at the founding of the Student Nonviolent Coordinating Committee, an organization that would help fuel the civil rights movement for years.

“Playing music at these kinds of situations, it wasn’t just another form of entertainment,” he once told the Chicago Tribune, which reported that he had been jailed four times. “It was sustenance for people going through hard times.”

The protesters, Mr. Carawan said, enlivened the song with their own touches.

“They said to me, in a nice way, ‘Put that guitar down, boy,’ ” he told the Los Angeles Times in 2003. “They had a way of singing with a Motown beat. They started singing with a triplet rhythm . . . an insistent beat; it was real powerful and just caught on that way.”

In March 1965, President Lyndon B. Johnson used the song’s words in a speech calling for legislation that became the Voting Rights Act of 1965. Three years later, King cited its chorus — “Deep in my heart, I do believe, we shall overcome” — in one of his final speeches before his assassination in 1968.

Decades later, the song has been sung in protest of oppression around the world, including in South Africa and Eastern Europe. “It only takes one person,” Seeger once said, “to teach it to a thousand.”

Guy Hughes Carawan Jr. was born in Santa Monica, Calif., on July 28, 1927. His parents were from the Carolinas, and he described himself as “part Southerner.” He played the ukulele in his youth, later picking up the banjo, guitar and hammered dulcimer.

Mr. Carawan served in the Navy during World War II before receiving a bachelor’s degree in mathematics from Occidental College in Los Angeles in 1949 and a master’s degree in sociology from University of California at Los Angeles in 1952. He later moved to the South, where he joined the civil-rights cause as a musician and activist.

After a tour in Europe, Mr. Carawan returned to the United States and joined the Highlander center, which had been established in 1932 to help alleviate poverty and other ills. He remained associated with the center until the 1980s.

With his wife and chief collaborator, Candie Carawan, he wrote books including “Ain’t You Got a Right to the Tree of Life?,” a photographic, oral and musical history of the culture of the Gullah community descended from African slaves.

The Carawans also wrote “We Shall Overcome!” and “Freedom is a Constant Struggle,” both collections of freedom songs, and “Voices From the Mountains,” about the lives and music of people in the Appalachian South.

His first marriage, to Noel Oliver Osheroff, ended in divorce. Survivors include his wife of 54 years, the former Carolanne “Candie” Anderson of New Market, and their two children, Heather Carawan of Tacoma, Wash., and Evan Carawan of Knoxville, Tenn.; and a granddaughter. Mr. Carawan died at his home in New Market and had dementia, his daughter said.

In the 1960s, Mr. Carawan, Seeger, the folk musician Frank Hamilton and Horton’s estate obtained a copyright for a version of “We Shall Overcome” and directed future proceeds to a fund benefiting art and activism in black communities.

“My job would be to help get people singing and sharing their songs,” Mr. Carawan said in the book “Everybody Says Freedom” by Seeger and Bob Reiser. “When someone began to sing, I’d back them up softly on my guitar so they’d get courage and keep going. Sometimes in sharing a song, people find bonds between themselves that they never knew they had.”