New York City Mayor Bill de Blasio, giving the keynote address Friday at his son Dante's graduation from the elite Brooklyn Technical High School, urged members of the senior class to devote their lives to resisting and combating injustice.

In a speech that cited the Black Lives Matter movement and his experience volunteering with Nicaragua's Sandinistas in the 1980s, the Democrat said he found his calling despite struggling with "the conflicting poles of optimism and pessimism" during his own high school graduation in June 1979.

"I looked at the world around me, and I saw a lot of injustice. And I saw a lot of suffering, some right where I live, some far away, but so much of it unanswered. And I felt very frustrated. So I wondered what could be done," de Blasio said.

He later supplied the answer, a quotation from the French anti-colonial novelist Albert Camus: "The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion."

The three-hour ceremony was held at the Barclays Center in Brooklyn. Yale-bound Dante de Blasio, 17 -- clad in flip-flops and a gown with no cap -- was one of 1,264 candidates for diplomas. The mayor sat near stage left with his wife, first lady Chirlane McCray, and their daughter, Chiara.

The mayor called the shootings of nine black churchgoers earlier this week allegedly by a racist gunman in South Carolina "unthinkable, unspeakable."

advertisement | advertise on newsday

"It would not be unfair for you to feel cynical or angry or frustrated," he said.

But, he said, "If you think about communities making change today, and the power of change today, you think about Black Lives Matter," de Blasio said, the antidote to "tragic violence this last year against black men and women in America."

Bridging racial division played a central role in Bill de Blasio's 2013 mayoral campaign, and the biracial teen and his signature Afro starred in a campaign commercial on police and race is credited with helping his father clinch the Democratic nomination. But Friday at the Barclays Center, the mayor's son was just another graduate.

Almost.

"Dante" -- a school official said over the loudspeakers before a theatrical pause as the teen walked to the front of the arena. "That's 'de Blasio,' right?"