(CNN) — Warner Bros. removed two lines of dialogue about a gay relationship for the Chinese release of its latest Wizarding World movie.

The six seconds of dialogue in “Fantastic Beasts: The Secrets of Dumbledore” discussed the romance between male characters Albus Dumbledore, played by Jude Law, and Gellert Grindelwald, played by Mads Mikkelsen. The lines cut are “I was in love with you” and “the summer Gellert and I fell in love.”

The film opened last week in China, the world’s biggest movie market, and one where the government is tightening its grip on censoring media.

In a statement to CNN Business, a Warner Bros. spokesperson said it’s “committed to safeguarding the integrity of every film we release” and that “extends to circumstances that necessitate making nuanced cuts in order to respond sensitively to a variety of in-market factors.”

“Dumbledore” opens this weekend in the US. (Warner Bros., like CNN, is owned by Warner Bros. Discovery.)

“Our hope is to release our features worldwide as released by their creators but historically we have faced small edits made in local markets,” the studio said. “In the case of ‘Fantastic Beasts: The Secrets of Dumbledore,’ a six-second cut was requested and Warner Bros. accepted those changes to comply with local requirements but the spirit of the film remains intact.”

Warner Bros. noted that it wants viewers around the world “to see and enjoy this film,” the third in the Fantastic Beasts series of Harry Potter prequels.

“It’s important to us that Chinese audiences have the opportunity to experience it as well, even with these minor edits,” the studio said.

In 2016, China’s top media regulator issued new guidelines that banned TV shows that promote “Western lifestyles,” including depictions of cleavage, drinking, smoking and homosexuality.

As a result, this is not the first time China has redacted LGBTQ plot lines. In February, major Chinese streaming platforms censored an storyline in the hit 1990s TV series “Friends” in which the character Ross is divorced after his wife Carol realizes she is lesbian.

In another example from March 2019, more than two minutes of LGBTQ content — including scenes of two men kissing and use of the word “gay” — were removed from Freddie Mercury biopic “Bohemian Rhapsody.”

The-CNN-Wire™ & © 2024 Cable News Network, Inc., a Time Warner Company. All rights reserved.

Join our Newsletter for the latest news right to your inbox