Hong Kong authorities on Wednesday withdrew an unpopular extradition bill that sparked months of chaotic protests that have since morphed into a campaign for greater democratic change.

Secretary for Security John Lee told the semi-autonomous Chinese city's legislature that the government had suspended the bill because it had resulted in "conflicts in society."

In order to clearly spell out the government's position, "I formally announce the withdrawal of the bill," Lee told lawmakers. Pro-democracy lawmakers immediately tried to question him but he refused to respond.

There are no signs that the withdrawal of the bill would dampen the protests, now in their fifth month. The rallies have snowballed into the city's biggest political crisis in decades, expanding to demands for universal suffrage and an investigation into allegations of police abuses, most recently including the spraying of a mosque and bystanders with high-pressure blue-dyed water from an urban assault vehicle.

The long-expected scrapping of the bill was overshadowed by the drama surrounding the release from a Hong Kong prison of the murder suspect at the heart of the extradition case controversy.

Chan Tong-kai, who completed a separate sentence for money laundering, told reporters after his release that he wished to turn himself in to authorities in Taiwan, where he's wanted for killing his pregnant girlfriend, Poon Hiu-wing.

Taiwan announced Tuesday it was willing to send a delegation to bring Chan back to the self-ruled island for trial, but Hong Kong rejected the offer, saying the suspect should be allowed to fly unaccompanied to turn himself in.

The controversy is rooted in the unwillingness of Hong Kong to recognize the legitimacy of the legal bodies in Taiwan, which communist leaders in Beijing consider a breakaway province.

China has refused all contact with the administration of Taiwan's directly elected President Tsai Ing-wen over her refusal to endorse Beijing's stance that the island is Chinese territory awaiting annexation. That appears to have compelled Hong Kong to reject co-operation with Taiwan over Taipei's insistence on a "mutual legal assistance" deal with Hong Kong that would require their institutions to deal with each other on an equal basis.

Tsai herself weighed in Wednesday on the Chan case, emphasizing that, although both the alleged perpetrator and the victim are from Hong Kong, Taiwan was willing to put Chan on trial if Hong Kong doesn't.

However, she said there was no possibility of Chan simply catching a flight to Taipei and insisted Taiwan would not sacrifice its sovereignty in handling the matter.

"I would like to explain that in this case, the murderer is a wanted subject in Taiwan. He is already a wanted criminal suspect in Taiwan with a warrant out for his arrest," Tsai said during a visit to the Taiwanese-held island of Kinmen just off the Chinese coast.

"Therefore, regarding this case, there is no issue of free travel or just being a backpacker. There is only the matter of arrest and no question of simply turning oneself in," Tsai said.

Taiwan's Mainland Affairs Council said allowing a murder suspect to fly on his own would ignore passenger safety and that Hong Kong's approach would indulge Chan and make Hong Kong "a criminal paradise where murderers can walk around."

Chan, 20, returned to Hong Kong alone last year after travelling to Taipei with Poon on vacation. Her body was found later packed in a suitcase and dumped in a field, while Chan made off with her bank card, mobile phone and other valuables.

"I am willing, for my impulsive actions and things I did wrong, to surrender myself, to return to Taiwan to face sentencing and stand trial," Chan told reporters outside prison before being whisked away by van to an exclusive gated community beyond the media's reach

Hong Kong leader Carrie Lam had repeatedly cited Chan's case as justifying the proposed amendments to the extradition legislation, saying he could not be sent to the self-ruled island because there was no extradition agreement in place.

But the proposal stoked widespread fears residents of Hong Kong, which has maintained its own independent courts since reverting from British to Chinese rule in 1997, would be put at risk of being sent into mainland China's Communist Party-controlled judicial system. Lam was forced to announce last month that she would drop the bill in the face of fierce opposition.

The protests have drawn international attention and Basketball Hall of Famer Shaquille O'Neal became the latest to weigh in. He defended Houston Rockets general manager Daryl Morey, whose swiftly deleted tweet supporting the movement set off a firestorm with Beijing, which tried to clamp down on the NBA.

"One of our best values here in America is free speech, we're allowed to say what we want to say and we are allowed to speak up about on injustices and that's just how it goes," O'Neal said on a TNT pregame show ahead of the season's opening night Tuesday. "Daryl Morey was right. Whenever you see something wrong going on anywhere in the world, you should have the right to say That's not right' and that's what he did."

------

Associated Press video journalist Taijing Wu in Taipei, Taiwan contributed to this report.