Actress Afshan Azad has thanked J.K. Rowling in a tweet marking the 20th anniversary of the first “Harry Potter” movie.

Azad, 33, played Padma Patil in the final five films in the fantasy franchise, winning a legion of fans across the globe.

On Tuesday, she took to Twitter to mark two decades since “Harry Potter and Sorcerer’s Stone” was released, writing: “When the film came out I was sucked into the magical world like every other kid. Little did I know years later I’d audition for a role that would change my entire life upside down. I owe everything to @jk_rowling, the casting agents and the Potter films.”

The tweet was liked more than 19,000 times, with followers praising Azad for recognizing Rowling — who penned the “Harry Potter” books.

However, Rowling has been under fire for controversial comments she made about the transgender community last year, with critics calling for her to be canceled.

The author has been excluded from an upcoming HBO Max special, Harry Potter 20th Anniversary: Return to Hogwarts,” and the film franchise’s three main stars — Daniel Radcliffe, Rupert Grint and Emma Watson — have been publicly critical of Rowling’s remarks.

Watson celebrated the 20th anniversary of “Harry Potter and the Sorcerer’s Stone” on Instagram without referencing Rowling at all.

The three lead stars of “Harry Potter” — Rupert Grint, Daniel Radcliffe and Emma Watson — have all spoken out against J.K. Rowling. They are pictured in 2001.
Getty Images

That has angered many, with The Telegraph releasing an article titled “J.K. Rowling made the ‘Harry Potter’ cast rich — how dare they drop her.”

Azad has been praised for recognizing Rowling, with one Twitter user responding: “Respect. You are braver and more gracious than some of your co-stars, that’s for sure.

Rowling is pictured with Radcliffe, Watson and Grint in 2010.
Getty Images

Another concurred, writing: “Thank you for growing up to be a mature person not influenced by social media peer pressure. It’s important to remember to show respect where RESPECT is due and no one is more deserving for all she has accomplished than JK Rowling [for what she] did with Harry Potter.”

However, Azad is not the only one to praise the bestselling writer.

Despite being critical of her comments about trans people, Radcliffe spoke highly of Rowling in a BBC documentary marking the two-decade anniversary.

“Jo really cares about the people that she writes for. She cares about the people she writes and the people she writes for,” he stated.

“She is an immensely intelligent, funny, kind human being and I think that obviously comes across in her writing.”