Richie Havens, the New York City folk singer thrust by circumstance onto center stage as the opening act of Woodstock, the legendary 1969 music festival, died April 22. He was 72.

He had a heart attack at his home in Jersey City, according to Tim Drake, president of his booking agent, the Roots Agency of Westwood, N.J.

Scheduled fifth on the program for opening day of the Woodstock Music and Art Fair, Aug. 15, 1969, Mr. Havens and two members of his band were pressed into urgent service as other musicians — including the planned opening act, the folk-rock band Sweetwater — fought traffic on the roads leading to Max Yasgur’s farm outside Woodstock, N.Y.

Mr. Havens had been among the first to arrive at the performers’ staging area in nearby Liberty, N.Y. As the afternoon wore on and the crowd, estimated at 500,000 people, waited for the show to begin, concert organizers persuaded Mr. Havens, along with his guitarist, Paul Williams, and his drummer, Daniel Ben Zebulon, to squeeze into a helicopter with their two conga drums and two guitars for the quick ride to the festival stage.

“I had the least instruments and the least guys,” Mr. Havens explained in a 2008 interview with Bloomberg Television, “and they said, ‘Richie, would you go over now?’ I said, ‘Yeah, it’s about time, I’ve been here since 5 o’clock in the morning.’ ”

Having gotten Mr. Havens to the stage, concert organizers implored him to kick off the festival.

“It had to be Richie — I knew he could handle it, and his powerful but calm demeanor was just what we needed to set the tone for liftoff,” Michael Lang, a co-creator of the Woodstock festival, recalled in “The Road to Woodstock,” his 2009 book. “Regardless of what he said, he was ready and needed the least preparation and gear. When he saw me coming, Richie looked scared and tried to walk away.”

Mr. Havens and his band mates opened Woodstock shortly after 5 p.m. with “Minstrel From Gault.” After their regular set, they performed multiple encores to buy time for fellow performers still struggling to reach the site.

“Like the trouper he was, he just kept going and going,” Lang wrote. “He’d get up to leave the stage and we’d send him back. He didn’t have a set list to draw from — but returned with song after song, and his band followed along. Finally, drenched with sweat, he gave us the look that this — his sixth or seventh encore — was it.”

Before that final encore, Mr. Havens painstakingly tuned his guitar while brainstorming what he had left to play. He told the crowd, “Freedom is what we’re all talking about getting. It’s what we’ve been looking for. I think this is it.”

As Mr. Havens recalled for Lang’s book:

“I start strumming my guitar and the word freedom comes out of my mouth as FREE-dom, FREE-dom, with a rhythm of its own. My foot takes over and drives my guitar into a faster, more powerful rhythm. I don’t know where this is going, but it feels right and somehow I find myself blending it into an old song — ‘Sometimes I Feel Like a Motherless Child’ — a great spiritual my grandmother used to sing to me as a hymn when I was growing up in Brooklyn.”

Mr. Havens’s improvised song — which went in part, “Freedom! Freedom! Sometimes I feel like a motherless child, a long way from my home” — became a landmark anthem of the three-day Woodstock event, which included performances by Jimi Hendrix, The Who, Janis Joplin, Ravi Shankar, and Crosby, Stills, Nash and Young. The song became an international hit after it was featured in the 1970 Woodstock documentary film.

“I think we as a generation were really seeking something like that to happen,” Mr. Havens said of Woodstock in the Bloomberg interview. “I call us the last speak-when-you’re-spoken-to generation, and because of that, we went out and started to do our own thing.”

Richard Pierce Havens was born on Jan. 21, 1941, in the Bedford-Stuyvesant neighborhood of Brooklyn, N.Y., the eldest of nine children.

His father made Formica tables and “was a pretty good musician, too, a piano player with a feel for jazz,” Mr. Havens wrote in a 1999 memoir. He said his grandmother, Beatrice Elizabeth Gay, “broadened my musical appreciation at every opportunity, teaching me Jewish folk songs and Irish ballads and playing old recordings of Caribbean island music she had carried with her from Barbados.”

He graduated from street-corner doo-wop groups to singing with the McCrea Gospel Singers as a teenager. Fired from his job as a portrait artist in Manhattan’s Greenwich Village after missing work one day, he began performing music. His first album, “Mixed Bag,” was released in 1967.

He formed his own record label, Stormy Forest, which released six of his albums. They included “Alarm Clock,” which featured Mr. Havens’s biggest hit single, his cover of George Harrison’s “Here Comes the Sun.”

Throughout the 1980s and 1990s, Mr. Havens recorded television commercial jingles for companies including Amtrak, McDonald’s and Cotton Incorporated, according to the Rolling Stone Encyclopedia of Rock & Roll.

Long active in causes related to the environment, he performed at the Environmental Inaugural Ball, one of the festivities associated with the inauguration of President Bill Clinton in January 1993.

He played a sold-out concert in 2009 at the Bethel Woods Center for the Arts, on the site of Woodstock, as part of events to mark its 40th anniversary.