Writer Walter Mosley quit “Star Trek: Discovery” in disgust after getting a formal complaint about him using the N-word in the writer’s room, according to new reports.

The author, who is African-American, first revealed in an op-ed for the New York Times on Friday that he had resigned from a high-profile gig after HR told him there had been complaints about his language.

“I am the N-word in the writers’ room,” Mosley, 67, had replied when first “chastised” for his use of the divisive term.

'STAR TREK: DISCOVERY' INFLUENCED BY TRUMP ELECTION

The “Devil in a Blue Dress” author did not name the show — but sources have now revealed to The Hollywood Reporter that it was CBS All Access’ “Star Trek: Discovery.”

“We have the greatest admiration for Mr. Mosley’s writing talents and were excited to have him join ‘Star Trek: Discovery,'” CBS TV Studios told the trade paper in a statement.

“While we cannot comment on the specifics of confidential employee matters, we are committed to supporting a workplace where employees feel free to express concerns and where they feel comfortable performing their best work.”

CBS ALL ACCESS' 'STAR TREK: DISCOVERY' TO FEATURE FEMALE LEAD

Mosley made it clear in his Times column that he had not called anyone the offensive term but merely “telling a true story as I remembered it.”

LOS ANGELES, CALIFORNIA - JULY 08: Writer Walter Mosley attends the premiere of FX's

Writer Walter Mosley attends the premiere of FX's "Snowfall" season 3 at Bovard Auditorium at USC on July 08, 2019 in Los Angeles. Mosley says he left "Star Trek: Discovery" over using the N-word in the writers' room. (Getty)

'STAR TREK: DISCOVERY' DIVIDES FANS WITH CONTROVERSIAL PHOTO

“I just told a story about a cop who explained to me, on the streets of Los Angeles, that he stopped all n—ers in paddy neighborhoods and all paddies in n—er neighborhoods, because they were usually up to no good. I was telling a true story as I remembered it,” he wrote.

He still does not know who complained, but was outraged when HR approached him about using the word he says is “in common parlance.”

“There I was being chastised for criticizing the word that oppressed me and mine for centuries,” Mosley wrote.

'STAR TREK: DISCOVERY' SHOWRUNNER DROPS DETAILS ABOUT KLINGONS

“There’s all kinds of language that makes me uncomfortable. … But I have no right whatsoever to tell anyone what they should and should not cherish or express.

“I do not believe that it should be the object of our political culture to silence those things said that make some people uncomfortable.”

He insisted, “If I have an opinion, a history, a word that explains better than anything how I feel, then I also have the right to express that feeling or that word without the threat of losing my job.”

He said his answer to HR “was to resign and move on.”

CLICK HERE TO GET THE FOX NEWS APP

“I was in a writers’ room trying to be creative while at the same time being surveilled by unknown critics who would snitch on me to a disembodied voice over the phone. My every word would be scrutinized,” he wrote.

“Sooner or later I’d be fired or worse — silenced.”

This article originally appeared in Page Six.