The Law Society of Hong Kong and the Hong Kong Bar Association are publicly defending a Hong Kong court's decision that has come under attack from the Chinese government, with the Law Society warning that "nothing should be said or done that will undermine, or will be perceived to undermine, judicial independence and the rule of law".

The statement by the Law Society, the city's usually conservative professional body for solicitors, was issued following an attack by China's National People's Congress on a Hong Kong court ruling that overturned a controversial mask ban. The ban, which prohibits the wearing of masks during public assemblies, was passed in October after Carrie Lam, Hong Kong's chief executive, enacted emergency powers that allowed her to bypass the territory's parliament. Demonstrators have worn masks throughout the protests to avoid police identification.

But the Hong Kong court ruled last Friday that the ban was incompatible with what is called the Basic Law – Hong Kong's mini-constitution. That did not sit well with the government in Beijing. China's National People's Congress issued a statement saying only the National People's Congress Standing Committee, the nation's top legislative body, had the power to decide whether Hong Kong laws complied with the Basic Law.

In addition to the Hong Kong Law Society, the Hong Kong Bar Association – the professional body for barristers – issued a statement in response to China's insistence that only it had the power to decide whether a Hong Kong law was constitutional.

"The courts in Hong Kong have previously struck down unconstitutional laws. There was no suggestion previously that the courts cannot do so," the bar association said in a statement. "As has been held by the Court of Appeal, Hong Kong courts must apply the letter and spirit of the Basic Law and the Bill of Rights and it is their 'duty' to strike down unconstitutional laws. Indeed, for a court not to decide any case which argues that a legislative provision is contrary to the Basic Law is to fail to uphold the Basic Law, which every judicial officer has sworn to do."

The Hong Kong government on Monday appealed the court decision overturning the mask ban and the High Court agreed to grant a one-week suspension of the ruling. The court has now extended the suspension until next month, allowing the ban at least temporarily to remain in effect. The court is expected to issue a decision on December 10.