This report, originally published in May, has been updated.

Since 1997, Hong Kong has operated under semiautonomous rule — with separate legal, political and economic systems from mainland China — and a de facto constitution, called the Basic Law, which allows for liberties such as freedom of the press and assembly. When Britain handed over the former colony, China pledged to preserve the “one country, two systems” framework through 2047.

But on June 30, Chinese President Xi Jinping signed a sweeping new national security law that will dramatically overhaul the city’s freedoms. The law went into effect on July 1 — the anniversary of the British handover.

The law delivers a major blow to the city’s pro-democracy movement, which carried out months of massive protests beginning last year that railed against Beijing’s influence over Hong Kong’s political leadership. In the weeks since its implementation, several prominent pro-democracy advocates have been arrested.

Here are several key questions about the situation, answered.

What is the 1997 agreement?

In July 1997, Britain and China signed an accord granting Hong Kong relative autonomy for at least 50 years. It was the culmination of more than a century of competition between London and Beijing over the city. Britain had technically leased much of modern-day Hong Kong since 1898, with a presence there going back much further.

But China continued to see Hong Kong as part of its territory. The 1997 agreement was intended to occupy the middle ground between two competing visions for the former colony. The semiautonomous territory continued to flourish as a global financial center while running many of its own affairs, despite China’s control over its defense and foreign relations.

Hong Kong still managed to forge its own relations with the United States and other countries. But since Xi Jinping took over leadership of China’s ruling Communist Party in 2012, he has repeatedly meddled with Hong Kong’s special status.

Although Hong Kong has its own legislature, its chief executive is not elected directly but chosen by a committee. Opponents of the system say China continues to exert undue control over that process.

What does the new law mean?

The details released in June described a law even harsher than what many had expected. Under the new rules, a maximum life sentence could be handed out for anyone found guilty of “separatism,” “subversion,” “terrorism” or “collusion with foreign forces.” The definition of terrorism will include acts of vandalism like those carried out by protesters during demonstrations over the past year.

The legislation offers more leniency toward those who agree to provide information about others. It will also pave the way for Beijing to install a new national security council in the city, with its members to be chosen by authorities in Beijing.

The law will also staff a new magistrate court and law enforcement agencies with Chinese authorities and increases police authority to “intercept communications and covertly surveil persons reasonably suspected of crimes against national security.”

How has the law been used so far, and how have people responded?

When the details of the law were published, people in Hong Kong began deleting their Twitter accounts, and political parties even disbanded as activists expressed fears they would be targeted for pro-democracy activism.

On Twitter, pro-democracy activist Joshua Wong wrote that the law “marks the end of Hong Kong that the world knew before.”

The first prominent arrests were made in late July, when authorities in Hong Kong arrested four people between the ages of 16 and 21, saying they were suspected of inciting secession. Police cited comments they made on social media, rattling residents who feared the new law would dramatically limit freedom of speech.

This week, in a major show of force, authorities raided the newsroom of pro-democracy newspaper Apple Daily, founded by media tycoon Jimmy Lai in 1995. They seized 25 boxes of material from the newsroom and told employees to stop filming the operation. Lai, 71, his sons and several executives of the newspaper’s parent company, Next Digital, were arrested. Seven other people were also arrested Monday, including Agnes Chow, 23, who first emerged as a public figure as a teenage protester in 2014.

“Hong Kong’s press freedom is now hanging by a thread, but our staff will remain fully committed to our duty to defend the freedom of the press,” Apple Daily said in a statement following the raid.

How has the United States responded?

In May, Secretary of State Mike Pompeo told lawmakers that he saw Beijing’s move as “the latest in a series of actions that fundamentally undermine Hong Kong’s autonomy and freedoms.”

“No reasonable person can assert today that Hong Kong maintains a high degree of autonomy from China, given facts on the ground,” he said at the time.

The announcement to Congress signaled sharp implications for the U.S. trade relationship with the city and could have far-reaching ramifications on trade in the international business hub. Hong Kong’s relative autonomy has allowed the city to maintain a special status that leaves it exempt from tariffs the United States has placed on China.

President Trump later announced that the United States will no longer treat Hong Kong and China separately on several major issues, including trade and extradition.

“My announcement today will affect the full range of agreements we have with Hong Kong,” Trump said in a news conference in May describing how the United States plans to revoke the city’s special status. He also accused China of a “pattern of misconduct.”

In June, the State Department implemented new visa restrictions on current and former Chinese Communist Party members linked to clampdowns on Hong Kong’s freedom. “President Trump promised to punish the Chinese Communist Party (CCP) officials who were responsible for eviscerating Hong Kong’s freedoms,” Pompeo said. “Today, we are taking action to do just that.”

Soon after, U.S. Commerce Secretary Wilbur Ross said in a statement that his department is suspending “regulations affording preferential treatment to Hong Kong over China, including the availability of export license exceptions.”

In August, the Trump administration imposed sanctions on 11 Hong Kong officials, including the city’s chief executive, Carrie Lam. The U.S. Treasury Department said the sanctions were due to the “draconian” law.

“The United States stands with the people of Hong Kong, and we will use our tools and authorities to target those undermining their autonomy,” Treasury Secretary Steven Mnuchin said.

China retaliated by sanctioning six U.S. lawmakers and five leaders of nongovernmental organizations.

How else has China encroached on Hong Kong’s internal affairs?

Despite Hong Kong’s guaranteed semiautonomy, Beijing has long pursued policies to erode its separate status from the mainland. In 2003, China tried to push the city to implement controversial sedition and security laws, which would have limited civil liberties. Mass protests erupted, and the legislation was abandoned.

In 2012, protests broke out again over Beijing’s attempts to influence Hong Kong’s educational system through the proposed introduction of a curriculum that praised Chinese communism.

And in 2014, a pro-democracy movement began to gain momentum as activists pushed back against China’s plans to influence the selection of the city’s chief executive. The protests eventually drew more than a million people to Hong Kong’s streets, and the demonstrations became known as the “Umbrella Movement,” after the umbrellas protesters carried to protect themselves from tear gas. The protests lasted 79 days but were ultimately quashed, leaving many young people feeling disenfranchised from the city’s political system.

What happened last year?

Last year, protests erupted again over concerns that Hong Kong would pass a bill allowing for individuals to be extradited to China. Opponents of the bill feared it would be used to crack down on anti-Beijing activists. Hong Kong’s leadership, led by Chief Executive Carrie Lam, tried to insist it would protect Hong Kong from outside criminals and would not impede on free speech.

The demonstrations lasted for months. In one major escalation last July, on the anniversary of the 1997 British handover, some protesters even broke into Hong Kong’s legislature, shattering windows and doors. The protests continued and at times turned violent. Police used rubber bullets, water cannons and tear gas to try to disperse the crowds. Protesters have also lashed out at police.

Lam tried to claim last July that the bill was “dead,” but most protesters saw her declaration as meaningless until the bill was formally withdrawn. By September, she finally pulled back the bill, but the protests had ballooned into a movement centered on a broader set of democratic demands. The activists persisted, and Hong Kong authorities responded, at times with force. The police are facing accusations that they have used excessive force on protesters. In early October, Hong Kong police used live ammunition on demonstrators. Lam enacted emergency powers that banned face coverings that allow protesters to maintain anonymity.

As the city recovered from the initial wave of the coronavirus pandemic, Beijing was seeking new ways to tighten its grip. In May, in a major escalation, pro-Beijing lawmakers took over a committee that controls the city’s legislative agenda, with plans to push against dissent.

“It is obvious that Beijing has decided that they have no more patience for Hong Kong, that enough is enough,” pro-democracy lawmaker Claudia Mo told The Washington Post at the time. “We are now at the end of Hong Kong as we know. [Beijing is] telling Hong Kong people that it can do anything it wants, at whatever cost, and that it couldn’t care less about the consequences.”

Gerry Shih in Seoul and Shibani Mahtani in Hong Kong contributed to this report.