About a thousand people have held a noisy rally outside the police headquarters in downtown Hong Kong, calling for the release of protesters arrested during this month’s wave of political unrest, following a peaceful demonstration earlier on Wednesday.

The protesters, mostly dressed in black and many covering their faces with masks and wearing hard hats, occupied the streets around the police headquarters in Wan Chai after 10pm and chanted loudly “Shame on you” and “Release the righteous fighters” to the beating of drums.

Some used crowd-control barriers to form a barricade between the front entrance of the police headquarters and the protesters, while others placed barriers in front of the compound’s gates.

At one point, to the cheering of the crowds, a young man sprayed painted obscenities in large Chinese and English characters on the front wall of the police headquarters and unfurled a large Chinese scroll down the side of the building emblazoned with the message “Release the righteous fighters”.

Protesters also sprayed painted slogans on to walls around the compound, on doors as well as security cameras. Some tried to obscure cameras with umbrellas.

Police were seen standing guards inside the compound, with some wearing riot helmets and carrying shields.

Hong Kong has been rocked by its biggest political crisis in decades as millions have thronged to the streets this month to protest against a proposed law allowing for the extradition of individuals, including foreign nationals, to mainland China to stand trial.

Police used teargas and rubber bullets to disperse hundreds of thousands of people occupying the main thoroughfares outside the government headquarters on 12 June, drawing condemnation from international rights groups. Police said last week that 32 had been arrested over the demonstrations and five have been charged with rioting, which carries a maximum sentence of 10 years’ imprisonment.

Earlier in the evening, thousands of people gathered by the harbour front in the heart of Hong Kong’s central business district to continue the fight for the withdrawal of the controversial extradition law and to demand democracy.

The peaceful rally on Wednesday evening was aimed at keeping international attention on Hong Kong before the G20 summit in Japan, where the Chinese president, Xi Jinping, and his US counterpart, Donald Trump, are expected to meet later this week.

China has said it will not allow the G20 nations to discuss Hong Kong at the summit in Osaka, Japan.

“Free Hong Kong. Democracy now. Withdraw the evil law,” chanted the crowds, most of whom were wearing black.

Protesters gather as they rally against the controversial extradition bill in Hong Kong. Photograph: Anthony Wallace/AFP/Getty Images

Many who took part in Wednesday’s rally said they were frustrated by the refusal of the Hong Kong chief executive, Carrie Lam, to meet their demands.

After earlier mass protests, Lam suspended the extradition bill and apologised for the social disharmony caused, but stopped short of withdrawing it and condemning the police’s use of force.

“I want to let the world know that we won’t give up. We want democracy and freedom for Hong Kong,” said Alfred Liu, a trader in his 50s. “China is afraid of foreign pressure, but while it still needs Hong Kong, we must seize the opportunity to keep the pressure on.”

A speaker on the stage told the protesters: “We must tell the whole world how Carrie Lam’s administration has betrayed us – they refused to withdraw the bill and used excessive violence. We’re here because we don’t want the Communist party’s puppet to represent us, right?” The crowd applauded and cheered.

Earlier in the day, hundreds marched towards 19 foreign consulates to lobby international governments about the political crisis. Many of the protesters wore white T-shirts emblazoned with the message: “Liberate Hong Kong”, held up placards and chanted slogans, including: “Free Hong Kong”.

On their arrival, protesters read out their petition letters before handing them to consulate officials.

“In desperation we seek your engagement and assistance to fight back against this authoritarian regime with us,” a protester read from a letter addressed to Trump.