The venue, the Tai Kwun Center for Heritage and Arts, ultimately reversed course after a public outcry. But by the time Mr. Ma touched down here, his trip had became a sort of live demonstration of the struggle for free expression in China, as well as a test of whether his safety in this former British colony was guaranteed. (A few Hong Kong booksellers who sold banned political books disappeared in 2015 and later turned up in custody on the Chinese mainland.)

Flora Drew, Mr. Ma’s partner and longtime translator, wrote in an email that when she dropped him off for his flight to Hong Kong, she worried that she might not see him again. “I could tell he was thinking the same, although neither of us said anything,” she said.

Many people urged him not to make the trip, saying the festival was not especially important. “But he said it was precisely because it wasn’t that important that he felt it was important for him to go,” Ms. Drew said. “He was determined to carry on as usual, and not to let the censors win.”

In Hong Kong, Mr. Ma told reporters that while he did not think literature on its own could resist a political force, he saw the reinstatement of his invitation as a victory against self-censorship and a celebration of fiction’s healing powers. “Only in literature can we fully express the injustices of society, the extremes of human nature and our hopes for a beautiful future,” he said.

In an interview the next day, Mr. Ma pointed out an irony. When he lived in Hong Kong in the years before its return to Chinese sovereignty in 1997, local writers would tell him that mainland politics had no place in local prose, which they felt should be gentler and more tender. But that was years before the recent erosion of freedoms in the territory, whose “one country, two systems” arrangement was supposed to give it a high degree of autonomy until at least 2047.

Now, as with Tibetan culture, “the autonomy of Hong Kong literature and language is vanishing,” he said, speaking over espressos and jazz music in a dark-paneled hotel lounge. “It may take 10 to 20 years, but the process has started.”