African American novelist Walter Mosley has quit his job writing for a television show after being chastised for using the N-word in the writers’ room.

Mosley wrote about the incident in an opinion piece for the New York Times. He said that he had been relating a story to his fellow writers about a police officer who told him that he routinely stopped Irish Americans in African American neighborhoods and African Americans in Irish American neighborhoods.

Shortly thereafter, Mosley said, he received a phone call from a human resources employee who said, “Mr. Mosley, it has been reported that you used the N-word in the writers’ room.” Mosley writes that he responded, “I am the N-word in the writers’ room.”

“There I was being chastised for criticizing the word that oppressed me and mine for centuries,” Mosley writes. “There’s all kinds of language that makes me uncomfortable. Half the utterances of my president, for instance. Some people’s sexual habits and desires. But I have no right whatsoever to tell anyone what they should and should not cherish or express.”

Mosley said he then resigned from the show. He did not identify which television show he was working for, but The Hollywood Reporter, citing anonymous sources, reported that it was Star Trek: Discovery. That show’s network, CBS All Access, confirmed that Mosley had worked on the show, but declined to comment on the incident.

Mosley, who has also written for the show Snowfall, is the author of dozens of novels, most recently John Woman.

Michael Schaub is an Austin, Texas-based journalist and regular contributor to NPR.