In a surprise move, Chinese authorities on Monday released on bail five women’s rights activists whose detention had caused an international uproar.

The five, best known for staging peaceful “performance art” demonstrations to highlight women’s rights, were detained in early March because of their plans to mark International Women’s Day by distributing stickers and leaflets about sexual harassment on public transportation.

The arrests came as China has tightened the screws on activists and nongovernmental organizations in one of the most severe clampdowns on dissent in decades. But the detentions sparked outrage abroad and threatened to cast a shadow over President Xi Jinping’s state visit to the United States in September.

In New York, Xi is due to address a U.N. summit on women, co-hosted by the Chinese delegation to the world body. The arrests galvanized public opinion against his participation in the event.

Vice President Biden and Secretary of State John F. Kerry recently joined calls for the five women to be released, while several online petitions gathered millions of signatures globally.

Earlier Monday, China responded to the pressure with anger.

The Foreign Ministry said it had lodged a formal complaint with the U.S. government for interfering in China’s internal affairs. Last week, it brushed off comments from Hillary Rodham Clinton, who had tweeted that the arrests were “inexcusable.”

But against all expectations, attorneys said Monday that Li Tingting, 25, Wang Man, 32, Wei Tingting, 26, Wu Rongrong, 30, and Zheng Churan, 25, were released on guarantee pending further investigation.

Prosecutors appeared to have decided against charging the women. Under the terms of their release, they could be charged at a later date if police convince prosecutors that they have a case.

“I think the release is the result of unprecedented international pressure,” said Maya Wang, a Hong Kong-based China researcher at Human Rights Watch.

“This demonstrates that international pressure does have impact when it is strong enough,” she said. “I think the Beijing police probably had no idea of what a reaction the detentions — on International Women’s Day — would provoke, and the release is an attempt to ease this global outrage, especially ahead of President Xi’s upcoming visit to the U.S. in September.”

But Liang Xiaojun, Wu’s attorney, said he is not satisfied with the release of the detainees. “They are still criminal suspects and have regained only limited freedom,” he said. “They need to go to the police whenever they are asked, for one year. During the year, they are unable to continue their NGO career and will live under fear.”

Liang said he doubted that the women would be rearrested, because the authorities “have already reached their goal, which is stopping five feminists and warning the others.”

Police initially accused the women of “picking quarrels and provoking trouble,” but activists said the charge proved hard to substantiate because the women had not yet carried out their plan. Police then accused them of “gathering a crowd to disturb public order” in connection with protests the women had organized three years ago, activists said. Both charges carry a maximum sentence of five years in jail.

The earlier campaigns included “Occupy Men’s Room,” an event in 2012 that pushed for more public toilets for women, as well as subsequent protests against domestic violence.

The authorities targeted the women because they work for nongovernmental organizations, which partly depend on foreign funding, and because they turned women’s issues into a human rights matter, said Lu Jun, director of the Yirenping Center, which works to combat discrimination. Police raided the center’s offices last month.

The women were initially subjected to lengthy interrogations and deprived of sleep, according to their attorneys. Wu was denied hepatitis medicine for the first two weeks of her detention, while Wang developed heart problems as a result of the interrogations, their attorneys said; both were transferred to a hospital for part of their detention.

Over the weekend, parents and partners of the women wrote to prosecutors, asking them to release the detainees.

“These five women whom we deeply love haven’t done anything wrong, let alone broken any laws. As their families, we are proud of them and comfortable that we have raised good children for the party and the country,” the letter said. “. . . We hold on to our belief that the five girls are innocent. Opposing sexual harassment is lawful. Protecting women’s rights is lawful. Supporting equality between men and women is lawful.”

The arrests came as China’s largely rubber-stamp parliament was actively considering a law against domestic violence.