JK Rowling is facing widespread criticism from the transgender community and other activists after tweeting support for a researcher who lost her job for stating that people cannot change their biological sex.

The researcher, Maya Forstater, had been a visiting fellow at the Centre for Global Development, which in March declined to renew her contract.

A London judge this week upheld Forstater's dismissal.

The judge found that her views of sexual identity were “absolutist”, even if they violate someone’s “dignity and/or create an intimidating, hostile, degrading, humiliating or offensive environment”.

On Thursday, Rowling tweeted a response that said: “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? #IStandWithMaya #ThisIsNotADrill.”

The Harry Potter author is otherwise known for her liberal political views and many on Twitter labelled her a TERF (Trans Exclusive Radical Feminist).

Among those criticising her was the Human Rights Campaign, which tweeted: “Trans women are women. Trans men are men. Non-binary people are non-binary. CC: JK Rowling.”

A spokeswoman for Rowling said that the author would not have any further comment.