From there, Mr. Takei’s comeback snowballed. He played himself on sitcoms like “Will & Grace” and “The Big Bang Theory,” and he and Brad became the first gay couple on “The Newlywed Game.” That was soon after their wedding in 2008 at the Japanese American National Museum in Los Angeles; Mr. Takei is a trustee. His “Star Trek” co-stars Walter Koenig and Nichelle Nichols served as best man and best lady.

Mr. Takei’s gay rights advocacy came after years of outspokenness on other fronts. By the time he revealed his sexuality, he had already dabbled in politics. He narrowly lost a race for Los Angeles City Council in 1973, and later served on the board of the Southern California Rapid Transit District. In 1981, he testified in a Congressional hearing, calling for redress for Japanese-Americans who had been in the internment camps.

Mr. Takei had made his way in Hollywood at a time when Asian actors were mostly relegated to playing servants or ninjas. His earliest film work was dubbing English dialogue for the Japanese monster movies “Godzilla Raids Again” and “Rodan.” Later on, he appeared in a pair of Jerry Lewis comedies, playing characters he knew were racial caricatures.

“Those were stereotypes, and I terribly regret them,” he says now, adding that his agent at the time (also of Japanese descent) urged him to take the parts.

But “Star Trek,” which had its premiere in 1966, offered something different: a chance to work with a multiethnic ensemble on a show that obliquely tackled hot-button issues like the Vietnam War and civil rights.

Sulu, Mr. Takei said, “was a groundbreaking character. I mean, there he was as part of the leadership team of the Enterprise, smart as a whip. In fact, he was the best helmsman in Starfleet, and he was an Asian driver!”