Washington (CNN) -- The White House grooved to the Motown sound Thursday night, with an all-star lineup performing some of the most memorable songs from the hit factory that started in a Detroit basement.
President Barack Obama and first lady Michelle Obama hosted the tribute to the music from Berry Gordy Jr.'s Motown Record Corp. in a concert that will be broadcast on PBS later this year. It's part of its "In Performance at the White House" series.
Clapping, swaying and singing in the audience were Gordy himself, Motown superstars Stevie Wonder and Smokey Robinson, Vice President Joe Biden and his wife, Jill, and the Obamas as the music that helped shape a generation and beyond filled the East Room.
Obama called Motown's tunes the "soundtrack of the civil rights era" and cited how the popularity of music by Robinson and others crossed the color barrier to bring together racially mixed audiences.
He recounted the origins of Motown, with Gordy borrowing $800 to set up operations in the basement of a house on Detroit's West Grand Boulevard.
Wonder also paid tribute to Gordy, saying people would be singing and dancing to Motown music for centuries to come.
Actor and singer Jamie Foxx added an unpredictable element to the proceedings as master of ceremonies, challenging Obama to dance at one point, poking fun at Biden and changing the lyrics of the Temptations' "Get Ready" for the occasion by singing, "We won the e-lec-tion. The White House, babe, so much fun."
Speaking of Gordy, Foxx said the money from his publishing royalties could help erase the federal deficit and signaled to Obama that he and Gordy should talk.
When Foxx said "We're gonna paint the White House black," he immediately joked "Uh oh, look at all this security," and mimicked a security agent coming after him.
Foxx, John Legend, Seal and Nick Jonas opened with a Temptations' medley that included brief renditions of "Get Ready," "The Way You Do the Things You Do," "I Can't Get Next To You" and "Ain't Too Proud To Beg."
Next up was Sheryl Crow, a former backup singer for Michael Jackson, who performed the Jackson 5 hit "I Want You Back," followed by Jonas singing "I Can't Help Myself" by the Four Tops.
Ledisi sang the Mary Wells hit "My Guy," and Legend returned to perform Marvin Gaye's "Heard It Through the Grapevine," which Crow introduced as the greatest Motown hit of all time.
The trio of Natasha Bedingfield, Jordin Sparks and Ledisi sang the Supremes' "Stop in the Name of Love," complete with the hand-up dance move on the chorus. Seal returned in his silver shoes to croon the Temptations' hit "My Girl."
Bedingfield then sang Robinson's "Tracks of My Tears" as Smokey clapped and sang along in the audience, followed by Amber Riley of the television program "Glee" performing Wonder's "Living for the City" twice -- there was a technical glitch the first time.
The band Gloriana did "Ain't No Mountain High Enough," a hit by Gaye with Tammi Terrell as well as Diana Ross, and Mark Salling of "Glee" performed yet another Temptations' hit "Just My Imagination."
After Sparks returned for the Supremes' "Can't Hurry Love," Robinson finally took the stage with Crow for a duet on his hit, "You Really Got a Hold on Me," and then Wonder followed with his classic, "You Are the Sunshine of My Life."
"Berry, thank you for this incredible Motown ride," Wonder said, calling for the crowd to celebrate by "dancing in the streets" to introduce the showstopper of the same name, joined by all the other performers, as well as Martha Reeves of Martha and the Vandellas.
In a bit of Motown soul, Reeves brought down the band in the middle of the song to improvise some praise for Gordy as the music continued lightly, and then the Obamas and daughter Sasha took the stage for the rousing finish.