He had friends who were sent to mental hospitals by the courts or their parents. Once there, they were often subjected to electroconvulsive therapy or were lobotomized.

If a same-sex couple was caught dancing in a bar, they faced violence and arrest.

[Read more about the history of L.G.B.T.Q. communities in San Francisco.]

That context makes the work of Mr. Rustin, who didn’t deny his sexuality, all the more remarkable, he said.

“Every day, he could’ve been committed or killed,” Mr. Ramirez said.

Walter Naegle, Mr. Rustin’s surviving partner, said the man he knew would have seen a pardon less as a reflection of individual courage than a kind of “apology for the kind of persecution of that time.”

Mr. Naegle said he met Mr. Rustin in 1977, waiting for a light to change. They started talking, and “we just continued the conversation for about 10 years.”

He described his partner as a fighter — one who didn’t need the limelight to propel him.

Still, Mr. Naegle said, he believes it hurt Mr. Rustin to have made one part of his identity secondary as the civil rights movement picked up momentum.

It wasn’t until the early 1980s that Mr. Rustin began to become involved with gay rights advocacy.

“There were things that only he could do,” Mr. Naegle said.