HONG KONG — Years ago, the question of whether a writer critical of the Beijing government could speak publicly at a literary festival would be considered moot in this city, one of Asia’s premier political havens.

This week, however, a days-long drama surrounding British Chinese writer Ma Jian only added to a growing sense that the old Hong Kong — and the freedoms once enjoyed here — are fading fast.

The controversy began Thursday when the Tai Kwun Center for Heritage and Arts, a prominent cultural institution, abruptly announced it would cancel two Hong Kong International Literary Festival events planned for Ma — whose works have long been banned in mainland China — because the center did not want to provide a platform for “political interests.”

Tai Kwun, a government-backed institution, ultimately reversed its decision less than 24 hours before Ma was to speak, but not before its earlier cancellation had prompted an outcry and an unsuccessful effort by festival organizers to find another venue willing to host him.

Ma is the latest dissident to recently encounter hurdles in Hong Kong. Last week, a cartoonist canceled a solo exhibition following what he said were threats from mainland authorities. And on Thursday, Hong Kong immigration officials denied entry to Financial Times journalist Victor Mallet, whom it had expelled in an unprecedented move a month earlier.

Taken together, the incidents have reinforced concerns by pro-democracy activists, human rights observers and Western diplomats that Hong Kong’s status as a free-speech haven is swiftly eroding, either under direct pressure from Beijing or from the subtler effects of self-censorship.

Ma, 65, has been a thorn in Beijing’s side for decades. He recently published a new novel in Britain, “China Dream,” excoriating Chinese totalitarianism and President Xi Jinping’s vision for national greatness.

Speaking by telephone before departing London, Ma, 65, said he was puzzled by the last-minute uncertainty over his engagements, given that the festival’s agenda — and the rooms he was scheduled to speak in — had long been decided.

Ma said he was determined to fly to Hong Kong to find out if he could enter the territory at all and, if he could, demand an explanation.

“I want to know if this was an instance of self-censorship, or if there were greater political forces at play,” he said. “I need to know the truth.”

Tai Kwun said late Friday that it would host Ma after all because festival organizers could not find an alternate venue. The center’s director, Timothy Calnin, had said earlier that Tai Kwun did not want to “promote the political interests of any individual.”

Hong Kong was guaranteed a degree of political autonomy and freedom as part of a 1997 hand­over agreement between China and Britain that ended British colonial rule in the territory. But Chinese authorities, deeply alarmed by the eruption of pro-democracy protests in 2014 known as “the Umbrella Movement,” have tried to instill a sense of patriotism and have tightened political controls in ways large and small.

Hong Kong leaders, who answer ultimately to Beijing, have taken steps to block opposition candidates from assuming office in recent years, banned a pro-independence political party outright this summer and have taken a markedly tougher line against separatist advocacy. This month, prosecutors are set to try nine leaders of the 2014 protests on “public nuisance” charges.

Media organizations, business groups and Western governments were taken aback in October when Hong Kong expelled Mallet of the Financial Times, who had hosted a talk at the Foreign ­Correspondents Club with pro-independence activist Andy Chan despite demands by Hong Kong and Beijing officials to call off the event. 

Mallet left Hong Kong last month, and he was questioned by immigration officials for hours Thursday when he sought to re­enter as a tourist. He was eventually denied entry, the FT said Friday.

In an emailed statement, a British consulate-general spokesman said the Foreign Office was “very concerned by the authorities’ unprecedented rejection of a visa for a senior British journalist, which undermines Hong Kong’s freedom of speech and freedom of the press.”

Mark Field, Britain’s minister of state for Asia, was in Hong Kong this week and would raise Mallet’s case with local authorities “as a matter of urgency,” the statement added.

Political observers in Hong Kong say that although the government never acknowledged that Mallet’s ejection was retribution for hosting the talk with Chan — whom a former Hong Kong leader equated with a criminal — it sent a clear message to all businesses and institutions to step back from controversial activities.

“This is exactly how censorship and self-censorship foster each other,” said Maya Wang, China researcher for Human Rights Watch. “Everyone collectively moves back, far behind the red line, out of a sense of self-preservation.”

After several Hong Kong booksellers were widely believed to have been abducted by Chinese security agents in 2016, the city’s freewheeling political publishing industry similarly withered, as stores voluntarily folded and writers shied away from digging into Chinese politics.

Ma, the British novelist, said on Twitter last week that he has not been able to find a Hong Kong publisher for “China Dream” because they were “too afraid.” Publishers in Hong Kong, he told local media, insisted that he rename a character he had called “Xi Jinping.”

Penguin, his British publisher, has been bolder, describing Ma’s new novel on its website as “an arrow at President Xi Jinping’s ‘China Dream’ propaganda” and “a biting satire of totalitarianism.”

Ma, who published a book early in his career about Tibet — another third rail of Chinese politics — remains persona non grata in the country of his birth and has not been back in decades. He was denied entry when he last attempted to cross the southern border from Hong Kong in 2011.

He lived for years in Hong Kong, where he holds permanent residency. He moved to Britain in 1997 when the territory was handed back to China. 

“After 1997, I thought Hong Kong would have at least another 50 years of freedom,” he said. “I did not expect intellectual censorship to grow step by step this bad, this fast.”