Author J.K. Rowling has been slammed by stars and fans on Twitter after posting a string of "transphobic" tweets.

The Harry Potter author took to the social media platform over the weekend to share a string of controversial posts.

"If sex isn’t real, there’s no same-sex attraction. If sex isn’t real, the lived reality of women globally is erased. I know and love trans people, but erasing the concept of sex removes the ability of many to meaningfully discuss their lives. It isn’t hate to speak the truth,” she wrote. "The idea that women like me, who’ve been empathetic to trans people for decades, feeling kinship because they’re vulnerable in the same way as women - ie, to male violence - ‘hate’ trans people because they think sex is real and has lived consequences - is a nonsense.

"I respect every trans person’s right to live any way that feels authentic and comfortable to them," Rowling added. "I’d march with you if you were discriminated against on the basis of being trans. At the same time, my life has been shaped by being female. I do not believe it’s hateful to say so."

The 54-year-old also tweeted her frustration after seeing an article with the comment that “gender non-binary persons menstruate”. Reposting the article, she penned in the caption: “‘People who menstruate.’ I’m sure there used to be a word for those people. Someone help me out. Wumben? Wimpund? Woomud?”

However, the star's comments were not well received, with fans and famous followers alike slamming her for sharing the allegedly transphobic messages.

"This woman is complete scum. Shut the f**k up you transphobic f**k. You don’t know or love any trans people if you won’t even acknowledge their existence. Thanks for ruining the books of my childhood. Just stop talking. We know you’re a TERF (trans-exclusionary radical feminist). You don’t need to keep doing this," commented activist Ben O'Keefe, to which actress Sarah Paulson replied, "Word. Goodnight and shut up @jk_rowling."

Whitney Cummings added” "All these trans friends JK Rowlings (sic) says she has must be exhausted.”

Rowling has not yet responded to the criticism.