Allen Toussaint, the gentlemanly Rock and Roll Hall of Fame songwriter, producer, pianist and singer whose prolific, multiple-decades career cast him as the Renaissance man of New Orleans music, died of an apparent heart attack following a concert Monday night in Madrid. He was 77.

As a young man, Toussaint was the golden boy of the golden age of New Orleans rhythm and blues, writing and producing signature songs for multiple artists. His hundreds of credits include Ernie K-Doe’s “Mother-in-Law” and “A Certain Girl,” Irma Thomas’ “It’s Raining” and “Ruler of My Heart,” Benny Spellman’s “Lipstick Traces” and “Fortune Teller,” Art Neville’s “All These Things,” Lee Dorsey’s “Ride Your Pony” and Chris Kenner’s “I Like It Like That,” as well as seminal recordings by Aaron Neville, the Meters and Dr. John.

Performers who covered his compositions include the Rolling Stones, The Who, Bonnie Raitt, Boz Scaggs and Phish, among many others. In the years since his acclaimed post-Hurricane Katrina collaboration with fellow songwriter Elvis Costello, Toussaint enjoyed a late-career resurgence as a touring artist.

“He was an irreplaceable treasure of New Orleans, in the ‘immortal’ category with Jelly Roll Morton, Mahalia Jackson, Louis Armstrong, Fats Domino and Professor Longhair,” said Quint Davis, the producer/director of the New Orleans Jazz & Heritage Festival. “He was a one-man Motown. He created an entire era of New Orleans rhythm and blues.”

In his songwriting and conversations, Toussaint could craft a turn of phrase with an elegance and economy that rendered it indelible.

He once said that he tries “to remain as open as I can for inspiration all the time,” but he preferred late-night composing. “I especially like the wee hours of the morning, like 3. It’s quiet. The air is different. I like that time of night for anything.”

A consummate professional, he conducted himself with a gracious ease that embodied the evocative imagery of his original, wistful version of “Southern Nights,” which Glen Campbell later turned into a pop-country smash.

Soft-spoken and mild-mannered, Toussaint cut a stylish figure as he navigated New Orleans in either a two-toned 1974 Rolls-Royce bearing the vanity plate “Piano” or a more contemporary Mercedes-Benz with the license plate “Songs.”

He was a familiar sight at functions and benefits around town. He had been slated to play a Dec. 8 benefit concert with Paul Simon for New Orleans Artists Against Hunger and Homelessness at Le Petit Theatre du Vieux Carre.

“Allen was never not at the height of something,” Davis said. “Everything he did was at such a high level his whole career.”

Taught himself to play

Toussaint was born in 1938. He grew up in the Gert Town neighborhood as the youngest of three children. He taught himself to play the family’s upright piano, influenced heavily by the syncopated style of New Orleans legend Professor Longhair and Ray Charles, whom he heard on the radio. Barely 13, he joined an R&B band called the Flamingos, which featured Snooks Eaglin on guitar.

He dropped out of high school to pursue a career in music. He became a fixture around local recording studios, where he was sometimes asked to mimic the style of Fats Domino and other pianists. He learned much about the art of crafting a song from Dave Bartholomew, Domino’s producer and co-writer.

Toussaint’s first recording under his own name was an instrumental album called “The Wild Sound of New Orleans,” released in 1958 by RCA. He was billed as “Tousan,” reportedly because the record label didn’t think consumers outside New Orleans could pronounce “Toussaint.”

Under the auspices of the Minit and Instant record labels, he soon discovered his true calling: as a songwriter, arranger, producer and accompanist for other artists. At the home he shared with his parents, Naomi and Clarence, and siblings Vincent and Joyce, he often hosted rehearsal and writing sessions that resulted in a remarkable run of regional and national hits. Irma Thomas once recalled that “It’s Raining” was “written in Allen Toussaint’s bathroom.”

Not even a two-year hitch in the Army beginning in 1963 could stem his creativity. Backed by an Army band, he wrote and recorded a breezy instrumental called “Whipped Cream.” Trumpeter Herb Alpert & the Tijuana Brass turned “Whipped Cream” into a massive hit; their recording also served as the theme music for TV’s “The Dating Game.”

Toussaint was well-versed in the business of music. He and business partner Marshall Sehorn formed a production company, Sansu, then built a recording studio, Sea-Saint, in the Gentilly neighborhood that served as Toussaint’s private musical “sandbox.”

He recruited members of the Meters, a pioneering funk band that was working at the Bourbon Street club the Ivanhoe, to serve as Sansu’s and Sea-Saint’s house band. The Meters released a string of classic singles and albums under their own name, even as they backed Dr. John, Lee Dorsey and other acts that Toussaint produced.

His reputation earned him a client roster that reached well beyond New Orleans. He produced the 1974 smash “Lady Marmalade” for the female group LaBelle. Paul McCartney and his band Wings recorded much of their 1975 album ‘’Venus and Mars” album at Sea-Saint. Robert Palmer cut much of his 1974 debut “Sneakin’ Sally Through the Alley” there.

Toussaint recorded several albums of his own in the 1970s.

Songs with many lives

Over the decades, many of his songs have lived multiple lives as succeeding generations of artists rediscovered and re-recorded them. His “Fortune Teller” was first recorded by Benny Spellman in 1962. But it would later be covered by the Rolling Stones, The Who, the local band the Iguanas, and Robert Plant and Alison Krauss, who included it on the million-selling, Grammy-winning 2007 album “Raising Sand.”

“Working in the Coal Mine,” originally recorded by Lee Dorsey, would be covered by both the quirky New Wave band Devo and the mother-daughter country duo, the Judds.

Toussaint never publicly criticized the liberties that other artists took with his songs, which generated a steady steam of royalties for him. He once described his original “Southern Nights” as a “message in the trees, along with the breeze, and that whole Southern night feeling, just a nice, soft message. Glen (Campbell) and that bunch stomped it off, ‘one, two, one, two, three.’ I thought that was really fine, that they were innovative enough to do that to it. They heard another drummer.”

By the 1980s, Toussaint’s own recording career had tapered off, though he continued to produce and promote other artists via his NYNO Records label. More recently, he explored instrumental, piano-based jazz, as on his Grammy-nominated 2009 album “The Bright Mississippi.”

His many accolades included the National Medal of Arts, which he received from President Barack Obama during a 2013 awards ceremony at the White House. That same year, he was named an honorary doctor of fine arts by Tulane University, alongside fellow honorees Dr. John and the Dalai Lama.

For most of his career, Toussaint was a reluctant performer, content in his lucrative role as the man behind the curtain. For years, he rarely performed other than at an annual evening concert aboard the riverboat President during Jazz Fest.

That changed following Hurricane Katrina, which he rode out in a downtown hotel as his longtime home in the Gentilly neighborhood was inundated. With his hometown in ruins, he retreated to New York City, where he performed at several benefits for the Katrina relief effort. After sharing stages with him in New York, longtime fan Elvis Costello pitched Toussaint on the idea of a collaborative album.

A new late-life career

In late 2005, they finished what became “The River in Reverse” at Piety Street Studio in the Bywater neighborhood. Released in 2006, “The River in Reverse” kickstarted a new career for Toussaint as a touring artist. He and Costello performed around the world to promote the album, alternating songs from their respective catalogs and their joint album. Toussaint continued to be an enthusiastic performer for the rest of his life.

“He fell in love with performing, which hadn’t been his personality,” Davis said. “That’s what he was doing when his time was up.”

According to Davis, Toussaint was seemingly in good health recently. In late October, he joined Irma Thomas, Buddy Guy, Buckwheat Zydeco, Tab Benoit and dozens of other artists for the Legendary Rhythm & Blues Cruise, which departed from Fort Lauderdale, Florida, for a week’s worth of shipboard performances across the Caribbean.

A week later, he traveled abroad for a brief European tour with his quartet. But while onstage Monday at Madrid’s Teatro Lara, he started feeling ill and began sweating profusely. Nevertheless, Davis said, he returned to the stage for an encore of “Play Something Sweet (Brickyard Blues).” Later that night, he was discovered unresponsive at a hotel. Paramedics reportedly arrived quickly, but Toussaint was pronounced dead en route to a hospital.

Indicative of Toussaint’s status in the broader world of popular music, a litany of marquee acts, from the Rolling Stones to Harry Connick Jr., expressed their condolences on social media as the news of his unexpected passing spread.

In a statement released via Twitter, McCartney said, “Having worked with him in New Orleans, I know what a sweet and gentle guy he was, and a massive songwriting talent. ... His songs will be cherished by people like me who will have fond memories of Allen forever.”

Dr. John, according to his publicist, was “heartbroken” at the loss of his friend. Aaron Neville posted a statement on Facebook that read in part, “I want to first thank him for believing in me during my early days of singing. He produced my first recordings back in 1960 to 1964, on Minit Records. Later, in 1972, he recorded me again with songs like ‘The Greatest Love’ and ‘Hercules.’ He was an icon in the music business.”

Neville went on to call Toussaint, with whom he co-founded New Orleans Artists Against Hunger and Homelessness, “a great humanitarian. ... I know he is loved by a lot of people from New Orleans and around the world for helping them in their careers. He was a great person and a great songwriter and producer. But most of all he was a gentleman. He will be missed by the music world. My heart is sad. His family is in my prayers.”

Davis was in Memphis, Tennessee, the day that city’s most famous resident, Elvis Presley, died. “It was like everybody lost someone in their family.” With Toussaint’s passing, Davis said, “it’s a little like that for New Orleans. We all lost someone who we felt was family.”

Survivors include a son, Clarence “Reginald” Toussaint, who often performed as a percussionist in his father’s band; a daughter, Alison Toussaint LeBeaux, who helped manage her father’s career; and several grandchildren.

Funeral arrangements are pending.