HONG KONG — A landmark national security trial opened Monday in Hong Kong for prominent activist and publisher Jimmy Lai, who faces a possible life sentence if convicted under a law imposed by Beijing to crush dissidents.

Lai, a 76 year-old Catholic, was arrested in August 2020 during a crackdown on the city’s pro-democracy movement under the sweeping national security law enacted following huge protests four years ago. He was charged with colluding with foreign forces to endanger national security and conspiring with others to put out seditious publications.

The closely watched case — tied to the now-shuttered pro-democracy newspaper Apple Daily that Lai founded — is widely seen as a trial of press freedom and a test for judicial independence in the Asian financial hub.

China promised that the former British colony could retain its Western-style civil liberties for 50 years after returning to Chinese rule in 1997. But in recent years, the Hong Kong government has severely limited free speech and assembly and virtually eliminated political opposition under the rubric of maintaining national security. Many leading activists were arrested, silenced or forced into self-exile.

Lai’s trial is Hong Kong’s first on charges of collusion with foreign forces. It also targets three companies related to Apple Daily.

Lai smiled and waved at his supporters after he walked into the courtroom. Some members of the public waved at Lai to show their support. Hong Kong’s Catholic Cardinal Joseph Zen, a vocal democracy advocate in the city, and representatives from foreign consulates were among the attendees.

Before opening statements, Lai’s lawyer Robert Pang, facing the prosecution in court, said the sedition charge his client faced didn’t follow proper legal procedures.

Pang argued the law required the prosecution of sedition charges to begin within six months after an alleged offense was committed and that prosecutors failed to do that in Lai’s case.

Three judges, approved by the government, are overseeing the proceedings. The trial is expected to last about 80 days.

Last year, six former Apple Daily executives entered guilty pleas to collusion charges, admitting to the court they conspired with Lai to call for sanctions or other hostile activities against Hong Kong or China. They were convicted and await sentencing behind bars.

Some of the former executives, alongside two others who also pleaded guilty to collusion charges, were expected to testify as witnesses for the prosecution of Lai.

Outside the court building, there was a heavy police presence. Dozens of residents lined up to attend the hearing hours before it started.

Jolly Chung, 29, was among the first in the line, saying she would try to get in to observe the proceedings whenever she could.

“As a Hong Konger, I want to witness this, even though I know he will lose,” she said.

Andy Sung, in his 40s, said he came to witness history. “Choosing to come here is a small practice of some sort of resistance,” he said.

Pro-democracy activist Alexandra Wong, popularly known as “Grandma Wong,” was blocked from approaching the court building by police officers.

“Support Jimmy Lai, support the Apple Daily, support the truth,” she chanted.

Lai’s trial was originally scheduled to start in December 2022 but was postponed while the Hong Kong government appealed to Beijing to effectively block his attempt to hire a British defense lawyer. City authorities subsequently barred the lawyer, Timothy Owen, from representing Lai, saying it would likely pose national security risks.

Last week, Lai’s son Sebastien met with Britain’s foreign secretary, David Cameron, to lobby for Britain’s help in freeing his father, who holds British citizenship.

Cameron said in a statement that the security law is a “clear breach” of the Sino-British Joint Declaration and its continued use shows China has broken its international commitments.

British and Chinese authorities signed the agreement in 1984, stipulating that Hong Kong would retain a high degree of autonomy and freedoms for 50 years.

Cameron said he was particularly concerned by the “politically motivated prosecution” of Lai. He urged Chinese officials to repeal the security law and release Lai.

“Jimmy Lai has been targeted in a clear attempt to stop the peaceful exercise of his rights to freedom of expression and association,” Cameron said.

The U.S. condemned Lai’s prosecution and urged authorities in Hong Kong and Beijing to respect press freedom, U.S. State Department spokesperson Matthew Miller said.

“We call on Hong Kong authorities to immediately release Jimmy Lai and all others imprisoned for defending their rights,” he said.

The European Union said in a statement that it deplored the charges against Lai and that his trial undermines confidence in the city’s rule of law and is detrimental to the financial hub’s attractiveness.

When asked for comment about the Western condemnation of the security law, Chinese Foreign Ministry spokesperson Wang Wenbin said during his daily briefing: “The U.S. and U.K. statements making such irresponsible remarks on the ongoing judicial process is against the spirit of the rule of law, international law and the basic norms of international relations.” Wang added that it ”was politically motivated and a 100% double standard. China firmly opposes this.”

He said the Chinese government supports the city in upholding national security and that attempts to smear the security law “will never succeed.” He also accused Lai of being “the major mastermind” in the city’s “anti-China riots” and “an agent and pawn of the anti-China forces.”

Hong Kong leader John Lee told reporters he was confident in the city’s judicial system and in the professionalism of its courts. Lee said some people, particularly representatives of foreign governments, tried to exert pressure in an effort to influence the court presiding over Lai’s case, an action he said violated the spirit of rule of law.

Hong Kong, once seen as a bastion of media freedom in Asia, ranked 140th out of 180 countries and territories in Reporters Without Borders’ latest World Press Freedom Index. The group said the city had seen an “unprecedented setback” since 2020 when the security law was imposed.

Online news outlet Stand News, known for its openly critical stance against the Hong Kong government, was forced to shut down under the crackdown, with its two former top editors being charged with sedition.

The governments of both Hong Kong and China have hailed the law for bringing back stability to the city.

In Beijing, Chinese President Xi Jinping met with Hong Kong leader Lee on Monday and affirmed the latter’s work over the past year. Xi said Lee — who was in Beijing on his annual trip to report on what’s happening in the territory— has led an administration to firmly safeguard national security and overhaul the system of district councils.

“(Efforts by your government) strengthened the trend of Hong Kong moving from chaos to order,” Xi said during the city leader’s annual work trip to report Hong Kong’s latest situations to Beijing.

Last week, Hong Kong held its first district council elections since new rules were introduced under Beijing’s guidance, effectively shutting out all pro-democracy candidates. Voter turnout plunged to a record low since the 1997 handover.

Associated Press video journalist Alice Fung contributed to this report.