NEW ORLEANS -- Legendary New Orleans musician Allen Toussaint, who racked up hits like "Working in the Coal Mine" and "Lady Marmalade" as a behind-the-scenes songwriter and producer before he gained new fame as a performer, died Tuesday, not long after a performance in Spain. He was 77.
Rescue workers were called to Toussaint's hotel in Madrid early Tuesday morning after he suffered a heart attack, said Madrid emergency services spokesman Javier Ayuso.
They managed to revive him, but Toussaint stopped breathing during the ambulance ride to a hospital and did not recover, Ayuso said. Toussaint performed Monday night at Madrid's Lara Theater. Toussaint's family confirmed his death in an emailed statement, thanking fans and friends for their condolences.
"He was a legend in the music world," said Quint Davis, who produces the New Orleans Jazz and Heritage Festival. Toussaint performed there so often -- starting in 1973 -- that Davis said Toussaint referred to the festival as his "annual concert."
Born in New Orleans' working class Gert Town neighborhood, Toussaint went on to become one of the city's most legendary and celebrated performers and personalities.
In the beginning, Toussaint was known mostly as an R&B songwriter and producer. He worked for the New Orleans-based Minit Records in 1960 before being drafted in the Army for two years.
He worked with such luminaries as Lee Dorsey, Art and Aaron Neville, Irma Thomas, the Meters, Joe Cocker and Ernie K-Doe.
Thomas remembered Toussaint, who produced her songs "It's Raining" and "I Did My Part," as someone who wrote beautiful stories set to music.
In the late 1950s and early '60s, Thomas and Toussaint and others would gather at Toussaint's mom's house to rehearse.
"I don't know how his mom put up with all of us in there all the time. But that's where we learned our songs," Thomas said. "That was the place to be, his mom's living room."
In 1973, with fellow songwriter Marshall Sehorn, he established his own recording studio called Sea-Saint Studio. There he worked with a succession of musicians including Paul Simon, Paul McCartney, Patti LaBelle, Cocker and Elvis Costello.
"Having worked with him in New Orleans I know what a sweet and gentle guy he was and a massive songwriting talent," McCartney said in a statement.
Toussaint had numerous hits to his name. He penned the 1966 Lee Dorsey classic "Working in the Coal Mine" and produced Dr. John's 1973 hit "Right Place, Wrong Time" and 1975's "Lady Marmalade" by the vocal trio Labelle.
Aaron Walker, who is working on a documentary about Toussaint, said he often wrote with specific people in mind -- thinking, for example, about Lee Dorsey's smile.
His influence could be felt far outside of R&B circles. The song "Southern Nights," which Toussaint wrote and performed, was later covered by country star Glen Campbell and hip-hop artists in the 1980s and '90s often sampled from his songs.
He eventually began performing more and producing his own albums in the 1970s. Onstage he often wore sequined and colorful suits, and even off the stage he was known as a snazzy dresser -- albeit one who often wore sandals.
"You always saw Allen with a coat and tie and wearing sandals," Davis said.
He drove a Rolls-Royce but otherwise lived a modest life in New Orleans, said Walker. In recent years he appeared on the HBO series "Treme."
Toussaint is a member of the Rock and Roll Hall of Fame and the Louisiana Music Hall of Fame. In 2013 he was awarded the National Humanities Medal by President Barack Obama.
He had been expected to perform a benefit concert along with longtime friend Paul Simon in New Orleans on Dec. 8 at Le Petit Theatre to raise money for New Orleans Artists Against Hunger And Homelessness.
Hurricane Katrina in 2005 flooded not only his home but his Sea-Saint studio, forcing Toussaint to flee to New York. The studio never reopened.
During Katrina he also lost most of his manuscripts, his gold records and many of his stage outfits, Davis said.
In New York, Toussaint focused largely on performing, often taking the stage in solo concerts at Joe's Pub on Lafayette Street. Irma Thomas said Toussaint didn't do much touring before Katrina but after the storm he felt he needed to tour and bring attention to the city and its music.
"There were so many musicians who needed to get back on their feet. He said 'Now's the time I need to do this,"' she said.
Like many New Orleanians, Toussaint couldn't stay away from the Crescent City forever. Nearly eight years after Katrina, Toussaint returned permanently to the city of his birth and so much of his musical inspiration.
He is survived by two children.
Alan Clendenning in Madrid, Spain and Bill Fuller in New Orleans contributed to this report.
This story has been corrected to show Toussaint had performed Monday night, not Sunday night; to show that he produced "Lady Marmalade" not wrote it; and to correct "Working in a Coal Mine" to "Working in the Coal Mine."