A decision by the Taiwanese authorities to impose a month-long halt on exports of medical-grade face masks has sparked controversy on the island.

Some Taiwanese celebrities criticised the decision, saying the government should show more empathy towards those hit by the coronavirus outbreak in China. But these critics were slammed on social media for their comments.

Sales of face masks have risen tenfold since the outbreak, with many retailers running out of masks in the past two weeks. Taiwan reported an eighth confirmed case of the virus on Tuesday.

The government, led by Premier Su Tseng-chang, has sought to reassure Taiwanese about the supply of masks. But the spike in infections everywhere, coupled with the pause in manufacturing for Chinese New Year, led Mr Su to announce last Friday a temporary halt in exports to ensure enough supplies on the island.

"Please don't panic and stock up, there is enough masks in Taiwan for everyone," he said.

Chinese netizens were up in arms over the "politicised" decision, with many complaining on Weibo about how "Taiwan wants (them) to die".

A few Taiwanese celebrities agreed. Singer Christine Fan Wei-chi blasted Mr Su on her Facebook page, denouncing him as "inhuman" and a "thug", while television presenter Dee Hsu said on Weibo that people should help one another.

"Hate is more awful than a virus," she added, while expressing support for her sister, actress Barbie Hsu, who has been buying masks in Japan to donate to Wuhan residents.

But the celebrities found themselves on the receiving end of a backlash, with many social media users saying they cared more about China because of their ties to the mainland. Barbie Hsu's husband is Chinese entrepreneur Wang Xiaofei, and Ms Fan has often performed in China, where she has 47 million followers on Weibo.

One comment posted on Ms Fan's Facebook page said: "Taiwanese people's lives are not important enough for you?" Another comment on Dee Hsu's Weibo account read: "I really admire you, but I hope you can understand we need to protect ourselves before we can do that for others."

Related Story Interactive: What we know so far about the coronavirus

Mr Su, too, defended the government's move, saying: "To save others, we must save our own first."

Many Taiwanese also posted appreciative comments on Mr Su's Instagram and Facebook accounts.

"It is great to have a government that actually does good work!" one said, while others expressed gratitude for the government's work.

Amid the backlash, Ms Fan on Tuesday posted an apology for "using emotional words".