"Harry Potter" author J.K. Rowling trended on social media Thursday morning — and not because she's coming out with a new book. The British author sparked a backlash after tweeting her support for a woman with a history of making comments considered transphobic.

"Dress however you please. Call yourself whatever you like. Sleep with any consenting adult who'll have you," Rowling wrote Thursday in her first tweet since September. "Live your best life in peace and security. But force women out of their jobs for stating that sex is real?"

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? #IStandWithMaya #ThisIsNotADrill — J.K. Rowling (@jk_rowling) December 19, 2019

She added the hashtags "#IStandWithMaya" and "ThisIsNotADrill," making it clear that she was referring to Maya Forstater, a British researcher who lost her job at a nonprofit think tank following a series of tweets that were criticized as transphobic. On Wednesday, a judge ruled against Forstater, who had filed a complaint against the think tank, the Center for Global Development, which works to reduce global poverty. The judge said Forstater's speech violated the "dignity" of transgender people and was not protected under U.K. law. Rowling sent her tweet shortly after the decision became public.

In tweets and Slack messages posted throughout 2018, Forstater criticized proposed changes to the United Kingdom's Gender Recognition Act of 2004, which would allow people to self-identify their gender.

"Some transgender people have cosmetic surgery, but most retain their birth genitals," Forstater wrote in one tweet. "Everyone's equality and safety should be protected, but women and girls lose out on privacy, safety and fairness if males are allowed into changing rooms, dormitories, prisons, sports teams."

In another, Forstater wrote that she would address people by their preferred personal pronouns but that she did not agree that "transwomen are women."

"I wouldn't try to hurt anyone's feelings but I don't think people should be compelled to play along with literal delusions like 'transwomen are women,'" Forstater wrote.

Rowling's public support of Forstater after the judge's ruling sparked accusations of "transphobia" from LGBTQ advocates. Rowling has more than 14 million followers on Twitter, and many have commented that it is "dangerous" for a public figure with that large a following to voice her support for Forstater.

.@jk_rowling says she's opposed to fundamentalism in any form, but she's promoting a harmful fundamentalism that endangers the LGBTQ community — particularly transgender youth. She should apologize. https://t.co/2Acq4S77SW — Alphonso David (@AlphonsoDavid) December 19, 2019

"J.K. Rowling says she's opposed to fundamentalism in any form, but she's promoting a harmful fundamentalism that endangers the LGBTQ community — particularly transgender youth," Alphonso David, president of the LGBTQ advocacy group Human Rights Campaign, tweeted. "She should apologize."

A number of self-identified "Harry Potter" fans were especially distraught that one of their "childhood heroes" would promulgate "harmful" messages about transgender people.

hi. breaking my hiatus real quick just to say: fuck what your childhood heroes say. trans people are real. trans people deserve to be protected, recognized, supported, and loved. if that infringes on your idea of feminism, you’re not actually a feminist at all. you’re a bigot. — casey mcchristmas 🎄☃️✨ (@casey_mcquiston) December 19, 2019

"Hi. breaking my hiatus real quick just to say: f--- what your childhood heroes say. trans people are real," Casey McQuiston, author of the queer romance novel "Red, White and Royal Blue," tweeted. "Trans people deserve to be protected, recognized, supported, and loved. if that infringes on your idea of feminism, you're not actually a feminist at all. you're a bigot."

Forstater, for her part, retweeted Rowling, writing, "This is all I wanted for Christmas."

This isn't the first time Rowling has been accused of transphobia. In October 2017, she liked a tweet promoting a Medium article that was criticized as transphobic. Then, in March 2018, she was accused of transphobia after liking a tweet that referred to trans women as "men in dresses," although her spokesperson claimed at the time that Rowling had swiped the "like" button by accident.

However, Rowling has also been praised for her LGBTQ support, including, perhaps ironically, her shooting down of the anti-trans tweets of conservative commentator Tomi Lahren. She was also acknowledged for retroactively identifying Dumbledore as gay in March — a decision that was met with mixed reviews and questions about her sincerity in advocating for the LGBTQ community.

Just because you retroactively made Dumbledore gay doesn't mean you get to be the supreme arbiter of queer issues Rowling, stop spreading this dangerous transphobic rhetoric — Jingle Elle Maruska (they/them) (@ellle_em) December 19, 2019

According to Stonewall, a U.K.-based LGBTQ advocacy group, trans people in the country regularly face discrimination and violence. Two in 5 trans people have experienced a hate crime or incident, nearly half of trans people don't feel comfortable using public facilities for fear of harassment, and a third of trans people report being discriminated against because of their gender identity when visiting a bar or a restaurant in the past year.

Follow NBC Out on Twitter, Facebook & Instagram