JK Rowling has come out in support of a researcher who was sacked after tweeting that transgender people cannot change their biological sex.

Maya Forstater lost her job in March after she posted tweets opposing government proposals to reform the Gender Recognition Act to allow people to identify as the opposite sex.

Ms Forstater, who worked as a tax expert at the Centre for Global Development, an international think tank that campaigns against poverty and inequality, took her case to an employment tribunal on the grounds that her dismissal constituted discrimination against her beliefs.

Employment judge James Tayler dismissed her claim on Wednesday, saying her views are “absolutist in her view of sex”.

Responding to the ruling, Harry Potter author Rowling wrote on Twitter: “Dress however you please. Call yourself whatever you like. Sleep with any consenting adult who’ll have you.

“Live your best life in peace and security. But force women out of their jobs for stating that sex is real?”

She added the hashtags #IStandWithMaya and #ThisIsNotADrill.

Following her tweet, Rowling’s name trended on Twitter as she prompted a divided reaction from fans.

Many people claimed Rowling is a “transphobe”, and the phrase “JK Rowling is a Terf” – referring to the term trans-exclusionary radical feminist – also trended on the platform.

A Terf is often used to describe feminists who express ideas that other feminists consider to be transphobic, including the belief that trans women are not women.

Actress Jameela Jamil accused Rowling of contributing to the “erasure, abuse and suffering” of trans people.

She quote tweeted the author and said: “Please follow more trans people, please read about their experiences in this world and know you are contributing to their erasure, abuse and suffering by supporting those who deny their identity/existence. Please wield your immense power to protect those most at risk.”

In a separate tweet, Jamil said she was unfollowing Rowling.

LGBT advocacy group the Human Rights Campaign sent a message to Rowling on Twitter, posting: “Trans women are women. Trans men are men. Non-binary people are non-binary. CC: JK Rowling.”

Grey’s Anatomy actress Sara Ramirez said she “wholeheartedly” disagreed with Rowling.

She added: “I stand with intersectional feminist humans, who recognize that trans women are real women, and against bigots like yourself.

“Bigotry masquerading as feminism is anything but. Your internalized distortions are helping me to continue dismantling mine. Thanks!”

However, other Twitter users welcomed the author’s comment, with many joining her in using the hashtag #IStandWithMaya.

Lewis star Laurence Fox voiced his support for Rowling on Twitter and used the hashtag.

He wrote: “You can’t change your biological sex. Sorry, not sorry. Having said that, identify however the f*** you like.

“I’ve been known to sport the odd dress on occasion. I have lovely ankles, you see.”

Ms Forstater was accused of publishing “offensive” tweets questioning government proposals to allow people to self-identify their own gender.

Judge Tayler ruled against Ms Forstater in a 26-page judgment, in which he said her views did “not have the protected characteristic of philosophical belief”.

He concluded Ms Forstater was not entitled to ignore the legal rights of a transgender person and the “enormous pain that can be caused by misgendering a person”.

Pride in London 2016
The dispute was widely seen as a test case (Daniel Leal-Olivas/PA)

The dispute was seen as a test case on whether a “gender critical” view – a belief that there are only two biological sexes – is a protected “philosophical belief” under the 2010 Equality Act.

Ms Forstater had argued “framing the question of transgender inclusion as an argument that male people should be allowed into women’s spaces discounts women’s rights to privacy and is fundamentally illiberal (it is like forcing Jewish people to eat pork)”.

Representatives for Rowling have been contacted for comment.