A man has been put to death in China in an execution that was kept from his family, sparking public outcry.

A Chinese court executed Zeng Chengjie, a businessman sentenced in 2011 for fraud and illegal fundraising, on Friday without notifying his family.

Zeng was in death row since his conviction but his execution caught the family off guard and condemned the decision.

The court defended Zeng’s execution in a post on its Weibo account on Saturday, saying “the law does not have a written rule that convicts being executed must see their families”.

The post sparked online fury among users who criticized the “ice cold” reply.

An apology was posted later in a turnabout from the earlier remark and a third post claimed Zeng was given the option to see his family but declined, the Beijing Times said.

The controversy comes as China’s leaders have called for a more credible justice system.

However, citizens say China is still far from attaining public confidence in judicial bodies, reports AFP.

“China has a long, long way to go before it has the rule of law,” Weibo user Lin Lvshan said.