On Saturday, he had an urgent message for his classmates, who were gathered before him in black caps and gowns in a steamy auditorium. You need to think about your “personal legend” and the influence you are having on younger people, he told them, because they look up to you whether you realize it or not.

Mr. Gathers said that when he was growing up, his role models had been cousins and uncles who belonged to gangs and hung out in a scruffy park in the Dorchester section of Boston.

He said he became comfortable in the streets. He was cool. He was tough. He never used drugs, he said, but he started dealing as a teenager to help his mother make ends meet.

And he gained some notoriety, starting at 9 when relatives were rounded up in a federal raid.

“I got a reputation,” he recalled in an interview after the ceremony. “Everyone felt comfortable around me, they liked me or they were scared of me. It was some sort of celebrity. And then being in solitary, and being in prison in general, it was like a celebration, to them.”

But he was unaware of the effect that he was having on his younger siblings. When he was 13, his younger sister was shot while she was sitting next to him. She survived. But in 2014, his brother, Jameil Williams, who adored him and followed his every move, was not so lucky. He was gunned down and killed at 22.