President Obama delivered a fiery sermon to black America on Thursday night, warning black parents that they must accept their own responsibilities by “putting away the Xbox and putting our kids to bed at a reasonable hour,” and telling black children that growing up poor is no reason to get bad grades.

“No one has written your destiny for you,” he said, directing his remarks to “all the other Barack Obamas out there” who might one day grow up to be president. “Your destiny is in your hands, and don’t you forget that. That’s what we have to teach all of our children! No excuses! No excuses!”

Mr. Obama spoke for 45 minutes to an audience of several thousand people, most of them black, clad in tuxedos and ball gowns, who had gathered in a ballroom of the Hilton New York to celebrate the 100th anniversary of the National Association for the Advancement of Colored People, the nation’s largest civil rights organization.

He was one part politician and one part black preacher as he spoke in lilting cadences, his voice quiet at times, thundering at others, in unusually personal terms. At one point, when his audience shouted back at him, repeating his words, he threw back his head and laughed, saying, “I’ve got an amen corner back there.”