The show opened with Lamar performing XXX, from his latest album Damn, as dancers marched with images of the American flag in the background.
Lamar was then joined by U2's Bono and The Edge, who appear on the studio version of XXX.
In an interlude, Chappelle appeared on stage.
"I just want to remind the audience that the only thing more frightening than watching a black man be honest in America is being an honest black man in America," Chappelle said.
Lamar came back on stage with a solo drummer dressed in a white robe as he performed Jay Rock's King's Dead.
Chappelle returned on stage.
"Is this on cable?" he said. "It's CBS? It looks like it's singing, but this brother's taking enormous chances. Rumble, young man, rumble!"
Lamar's performance ended with dancers falling to the ground one by one to sounds of gunshots.