HONG KONG (AP) - Prosecutors in Hong Kong dropped corruption charges on Thursday against a prominent singer and pro-democracy activist, after initially accusing him of providing entertainment to sway voters in a legislative by-election.

Anthony Wong, a Cantonese pop singer, and former lawmaker Au Nok-hin were both asked to pay a guarantee of 2,000 Hong Kong dollars ($257) each, and were given a binding-over order of 18 months during which they must be on good behavior.

Wong and Au were both arrested earlier this week by Hong Kong's corruption watchdog over accusations that a performance Wong gave at a political rally held by Au in 2018 violated the elections ordinance.

Wong, 59, performed two songs at the rally and urged attendees to vote for pro-democracy candidate Au in the legislative by-election. Au, who won the election, was also charged in part for publicizing the rally on social media and saying that Wong would be performing.

The watchdog said that providing others with refreshments and entertainment at an election event is “a corrupt conduct and a serious offense” and is against the elections ordinance.

But prosecutors said they were dropping charges because Wong sang only two songs and in consideration of his background and attitude.

Au has been behind bars since March, and is one of 47 activists arrested earlier this year under the territory's tough national security law over an unofficial primary held last year that authorities say was a subversive plot to paralyze the government.

Wong rose to fame in the 1980s as the vocalist for pop duo Tat Ming Pair and later embarked on a solo career.

He became an outspoken supporter of the city's democracy movement, backing the 2019 anti-government protests as well as the so-called Umbrella Revolution rallies in 2014. His support for the 2014 protests led to a ban on performing in mainland China and the removal of his music from streaming sites.

Their arrests came as the government cracks down on dissent in Hong Kong following the 2019 protests, leading to concern that the former British colony is losing the freedoms it was promised when it was handed over to Chinese control in 1997.

Beijing last year imposed the sweeping national security law, which has been used to arrest more than 100 pro-democracy figures. Changes have also been made to Hong Kong's election laws to reduce the number of directly elected lawmakers and give a largely pro-Beijing committee the leeway to nominate lawmakers aligned with Beijing.