“Star Wars: The Last Jedi” actress Kelly Marie Tran, the first woman of colour to play a lead role in “Star Wars”, has spoken out for the first time about the online harassment that caused her to wipe her social media accounts earlier this year.

Tran deleted all of her Instagram posts in June after being subjected to sexist and racist online abuse for her role as Rose Tico, reports variety.com.

“It wasn’t their words, it’s that I started to believe them,” Tran wrote in an essay for The New York Times.

“Their words seemed to confirm what growing up as a woman and a person of colour already taught me: that I belonged in margins and spaces, valid only as a minor character in their lives and stories,” she added.

She went on to explain that the ruthless criticism from trolls reinforced a narrative that she wasn’t good enough.

“Their words reinforced a narrative I had heard my whole life: that I was ‘other’, that I didn’t belong, that I wasn’t good enough, simply because I wasn’t like them. And that feeling, I realise now, was, and is, shame, a shame for the things that made me different, a shame for the culture from which I came from. And to me, the most disappointing thing was that I felt it at all,” she said.

She continued: “I believed those words, those stories, carefully crafted by a society that was built to uphold the power of one type of person – one sex, one skin tone, one existence.”

After Tran left social media last summer, “The Last Jedi” director Rian Johnson and Tran’s co-stars Mark Hamill and John Boyega were among those who came to her defence.

Tran, who was born in America, is the daughter of Vietnamese refugees. She said she grew up feeling like she didn’t belong because she was different.