George Takei. (. Andrew Harnik/Associated Press)

George Takei was first cast in “Star Trek” two decades after World War II, when American racism against his Japanese ancestry still burned strong.

Takei is also gay, and he played Lt. Sulu — who was revealed to be gay last year, 50 years into a series that has always celebrated diversity in its cast and stories, as Michael Cavna noted in The Washington Post.

So who better than Takei to respond to a spate of racist and race-tinged criticism that greeted a trailer for the series’ new installment, “Star Trek: Discovery,” featuring high-ranking black and Asian officers — women, to boot.

NextShark collected a choice sampling of comments below the trailer: “oh great a woman captain again”; “The captain looks like she was affirmative action’ed onto the bridge”; “BLM black.” There were plenty of racist slurs.

MSNBC brought Takei on Sunday to get his take — probably knowing that, aside from his Trekkie history, the actor has loudly protested Hollywood’s history of “whitewashing” American entertainment.

“People are finding the time to hate on ‘Star Trek’ for having diversity,” host Joy Reid prompted. “What?”

“Well you know — today, in this society, we have alien life-forms that we call trolls,” Takei replied.

He explained: “And these trolls carry on without knowing what they’re talking about and knowing even less about the history of what they’re talking about. And some of these trolls go on to be presidents of nations.”

Yeah, Takei was going to bring alien analogies and President Trump into this space fight.

The president actually hadn’t said anything about the new show, at least not in public. But Takei is no fan of Trump. He even wrote for The Post last year about how Trump’s threats to ban Muslims from the United States recalled the Japanese internments through which his family suffered during World War II.

Which came up again on MSNBC.

“These people claiming ‘Star Trek’ is racist genocide, or whatever, ‘white genocide,‘ don’t know what they’re talking about,” Takei said. “They’re equal to the president of the United States.”

“Discovery” actually features plenty of white, male characters — enough that some fans were criticizing it for not being diverse enough, before the trailer brought on the troll attack.

As Metro noted, the series’ casts have always looked more diverse than those of most contemporary shows: from the ’60-era run with Takei and a black female lieutenant, to later installments where a woman and a black man commanded star ships (as Michelle Yeoh will in “Discovery”).

Not all the critics of appearances by Yeoh and Sonequa Martin-Green (as the captain’s first officer) in the trailer resorted to racism.

As NextShark wrote, one commenter noted that the new series is a prequel to the original run — and there’s this fan theory that no women were allowed to captain star ships before Kathryn Janeway flew one in “Voyager.”

Never mind race or diversity, the commenter argued — the female captain in “Discovery” isn’t canon.

More reading:

MSNBC host’s conspiracy theory: What if Putin planned the Syrian chemical attack to help Trump?

Garfield’s a boy … right? How a cartoon cat’s gender identity launched a Wikipedia war.