Takei told The Associated Press on Thursday that his new onstage role as psychologist Martin Dysart in "Equus," helped inspire him to publicly discuss his sexuality.
Takei described the character as a "very contained but turbulently frustrated man." The play opened Wednesday at the David Henry Hwang Theater in Los Angeles, the same day that Frontiers magazine featured a story on Takei's coming out.
The current social and political climate also motivated Takei's disclosure, he said.
"The world has changed from when I was a young teen feeling ashamed for being gay," he said. "The issue of gay marriage is now a political issue. That would have been unthinkable when I was young."
The 68-year-old actor said he and his partner, Brad Altman, have been together for 18 years.
Takei, a Japanese-American who lived in a U.S. internment camp from age 4 to 8, said he grew up feeling ashamed of his ethnicity and sexuality. He likened prejudice against gays to racial segregation.
"It's against basic decency and what American values stand for," he said.
Takei joined the "Star Trek" cast in 1966 as Hikaru Sulu, a character he played for three seasons on television and in six subsequent films. He received a star on the Hollywood Walk of Fame in 1986.
A community activist, Takei ran for the Los Angeles City Council in 1973. He serves on the advisory committee of the California Civil Liberties Public Education Program and is chairman of East West Players, the theater company producing "Equus."