KUALA LUMPUR, Malaysia—Tens of thousands of protesters gathered in Kuala Lumpur on Saturday to demand the resignation of Malaysia’s Prime Minister Najib Razak, the day after police banned the protest and arrested two of the activists who planned it.

The arrests came hours after police and regulatory officials on Friday raided the office of the activist group known formally as the Coalition for Clean and Fair Elections, but better known as Bersih, the Malay word for clean.

​According to the pair’s lawyer, Bersih Chairwoman Maria Chin Abdullah was detained as part of a police investigation into whether she should be charged for the crime of attempting to undermine Malaysia’s parliamentary democracy. The lawyer said police arrested Mandeep Singh, who is secretary of Bersih’s secretariat, as part of an investigation into whether he should be charged with rioting.

It was unclear when they would be released, according to their lawyer.

Police later confirmed the arrests and subsequent detention of at least eight other Bersih activists. Law enforcers also told the Bersih group’s lawyers that Ms. Chin was detained under the country’s security laws while the investigation into her activities continued. Three organizers of a counter-demonstration by a pro-government group known as the Red Shirts were also arrested, according to the Red Shirt group. Police on Friday banned both rallies.