This article 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 such liberties as freedom of press and assembly. When Britain handed over the former colony, China pledged to preserve the “one country, two systems” framework through 2047.

That is set to change. On Friday, President Trump 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 describing how the United States plans to revoke the city’s special status. He also accused China of a “pattern of misconduct.”

His remarks followed Secretary of State Mike Pompeo’s formal declaration Wednesday to U.S. lawmakers that Hong Kong should no longer be considered autonomous from China. The announcement to Congress signaled sharp implications for the U.S. trade relationship with the city, followed Beijing’s proclamation last week that it plans to implement a sweeping national security law, which would criminalize secessionist activities and subversion in Hong Kong in the most dramatic encroachment on the city’s civil liberties yet.

The planned introduction of the law came as a major blow to the 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.

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.

How 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 once 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 in 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 in 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 recovers from the initial wave of the coronavirus pandemic, Beijing is seeking new ways to tighten its grip. This month, 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. “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.”

What did Pompeo tell Congress?

Pompeo told lawmakers on Wednesday 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.

His announcement 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.

How has Hong Kong responded, and what could happen next?

Protesters returned to the streets in recent days in response to China’s latest encroachment, as they have at earlier times in the city’s history when China moved to exert greater control.

Thousands of riot police were deployed throughout the city Wednesday as pro-Beijing lawmakers tried to push forward legislation that would make disrespecting the Chinese national anthem a crime in Hong Kong. Hundreds of protesters were arrested.

Police pepper-sprayed some protesters as they shouted “Free Hong Kong” and other pro-democracy chants.

“There is every reason to think there will be another wave of dramatic protests … and resurgence of activism,” Jeffrey Wasserstrom, a historian at the University of California at Irvine who studies Hong Kong, said after the law was introduced.

Unlike in mainland China, Hong Kong has retained, until now, the right to hold authorized demonstrations. But Lynette Ong, an associate professor of political science at the University of Toronto, said last week that she didn’t expect new protests to be as big as last year’s due to the rising risk of arrest and repression.

“I think there is a little bit of a protest fatigue,” she said. “I think people are not only tired, but it’s getting increasingly risky to one’s personal life and personal health to protest.”

Hong Kong appears to have successfully contained its coronavirus outbreak, for now. But authorities have nonetheless maintained a ban on gatherings of eight or more people, which they extended again for 14 days on May 19. The decision in effect banned for the first time the city’s annual June 4 commemoration for the victims of the 1989 Tiananmen Square massacre.

Wasserstrom said events like the annual memorial have in the past served as signs that the “two system” framework was working.

Instead, it increasingly “feels like a colonial system” for people there, he said.

Despite the expected outrage over China’s latest moves, Ong said she did not see any way out for Hong Kong. In theory, either the Hong Kong legislature could reject the bill or the United States could intervene. But with the legislature stacked in China’s favor and the United States embroiled in its own crisis — the coronavirus outbreak — she said neither are realistic.