Image copyright Getty Images Image caption Toussaint was inducted into the Rock and Roll Hall of Fame in 1998

US musician Allen Toussaint has died at the age of 77, Spanish authorities have confirmed to the BBC.

The award-winning artist was known for songs like Working In The Coalmine, Southern Nights and Fortune Teller.

He suffered a heart attack shortly after coming off stage at Madrid's Teatro Lara on Monday night, reported Spanish newspaper El Mundo.

He was found in his hotel and resuscitated - but suffered a second heart attack en route to hospital.

The mortuary at the Madrid's Hospital Fundacion Jimenez Diaz confirmed his death to the BBC.

A legend of New Orleans R&B, Toussaint worked with some of music's biggest stars - including Paul McCartney, Irma Thomas, Aaron Neville, Joe Cocker, Glen Campbell and Elvis Costello.

He had been due to play the London Jazz Festival this weekend.

Cover versions

Toussaint was born in 1938 in the working class neighbourhood of Gert Town, New Orleans.

He began learning piano at the age of seven, influenced by the likes of Huey "Piano" Smith and Ray Charles, and got his big break when he was asked to fill in for an absent Fats Domino at a recording session.

In 1960, Toussaint was hired by Joe Banashak's Minit record label and masterminded many of the company's biggest hits - including Irma Thomas's Ruler of My Heart (later recorded by Otis Redding as Pain in My Heart) and Benny Spellman's Lipstick Traces (On A Cigarette).

Drafted by the military in 1963, he continued to make music on service leave, but scored his biggest hits after his discharge in 1965.

His most successful collaborations were with singer Lee Dorsey, who recorded Toussaint's compositions Ride Your Pony, Get Out of My Life Woman, Working in a Coalmine and Everything I Do Gon' Be Funky.

New Orleans fundraising

Many of his songs became famous through cover versions, with the likes of The Who, The Rolling Stones, Robert Plant, Bo Diddley and The Doors re-interpreting his songs.

He also produced Labelle's signature hit Lady Marmalde in the 1970s, and released a collaborative album with Elvis Costello in 2006.

Toussaint was inducted into the Rock and Roll Hall of Fame in 1998. The citation said his greatest contribution "was in not allowing [New Orelans] old-school R&B traditions to die out but by keeping pace with developments in the rapidly evolving worlds of soul and funk.

"In addition, he brought the New Orleans sound to the national stage, and it remains a vital and ongoing part of our musical heritage to this day."

Following Hurricane Katrina, he campaigned tirelessly for his hometown, raising money to support those left destitute by the disaster.

In 2013, he was presented with America's National Medal of Arts, the highest honour given to an American artist.

"After his hometown was battered by Katrina and Allen was forced to evacuate, he did something even more important for his city - he went back," said President Obama at the award ceremony.

"Since then, Allen has devoted his musical talent to lifting up and building up a city. And today, he's taking the stage all over the world, with all kinds of incredible talent, doing everything he can to revive the legendary soul of the Big Easy."

Toussaint is survived by his two children, including his son Clarence, known as Reginald, and his daughter, Alison, both of whom managed his career in recent years, reported New Orleans' broadcaster WWL-TV.