US President Barack Obama paid homage to Memphis soul and the role the music style played in advancing civil rights at a star-studded White House concert celebrating the genre.

"In the sixties and seventies, Memphis knew its share of division and discord and injustice," Obama recalled on Tuesday. It was in the Tennessee city in 1968 that civil rights hero Martin Luther King Jr. was assassinated.

But soul music "tried to bridge those divides -- to create a little harmony with harmony," said the president, who walked on stage to the dulcet strains not of traditional presidential anthem "Hail to the Chief" but of "Green Onions," a well-known instrumental tune by Booker T. and the MG's.

The group, whose leader, Booker T. Jones, 68, directed the concert, was integrated, a rare feat in a city still marked by segregation, recalled Obama, himself the United States' first African-American president.

In early 1960s, the musicians "weren't allowed to go to school together. They weren't always allowed to travel or eat together," the president said.

"But no one could stop them from playing music together."

He made the audience laugh as he joked that he was speaking "not just as a President, but as one of America's best-known Al Green impersonators," referring to the famous soul singer.

Obama, during his 2012 re-election campaign, delighted a crowd when he sang on stage in New York several seconds of Green's "Let's stay together."

During a blues concert at the White House a month earlier, he was also convinced to take up the chorus of "Sweet Home Chicago."

Obama refrained from singing on Tuesday.

Among the stars who appeared during the concert were soul legend Sam Moore, from the famous Sam and Dave duo, singing their 1967 hit "Soul Man," alongside contemporary pop star Justin Timberlake, who sang Otis Redding's classic "Sitting on the dock of the bay."

Queen Latifah, Ben Harper and Cindy Lauper were on hand at the concert, which should air on April 16 on PBS television.