“I would understand the reaction if we came to China to provoke, but that is not the case,” Mr. Veit said. “We came there to have a dialogue. That is what theater is about.”

Chen Qiwen, a social media editor who watched the second, partly censored performance of the play the next night in Beijing, said he was not surprised that “An Enemy of the People” had set Chinese officials on edge. Under Xi Jinping, the strongman Communist Party leader, censorship and control of culture has reached new extremes.

“To me, it was not surprising at all that they canceled the oncoming performances in Nanjing,” Mr. Chen said by telephone.

He said the Beijing performance had been his best drama viewing experience this year, “not only because of the quality of the drama, but also the ridiculousness and absurdity that has been revealed through the interaction of what happened on and off stage, and the resemblance between the story and this country’s reality.”

The Schaubühne company has performed in China many times before, and Ibsen’s plays and their liberal themes have gone through periods of wild popularity in China — especially during the May Fourth Movement in the early 20th century. But this particular drama would seem to have plenty of potential to unnerve Chinese censors, and embolden their critics.

“An Enemy of the People” is about a small-town doctor in Norway who discovers the public baths are contaminated. He tries to reveal the scandal, but is run out of the town for threatening its tourist business.

The play’s themes of pollution, corruption and a tame, muted news media have clear resonance in many countries, not just China. Productions in the United States have jumped since the election of President Trump, who has used the phrase “enemy of the people” to describe many journalists.