The Constitutional Court of South Africa upheld a previous ruling Wednesday that effectively outlawed spanking and the use of any physical punishment against children nationwide.

The Times of South Africa reports that the case was brought to the Constitutional Court, the highest court in the country, by the civil society group Freedom of Religion South Africa (FORSA) as a challenge to a previous ruling from the South Gauteng High Court that deemed parents using physical force against their children as unconstitutional.

The debate began in 2017 when a man in Johannesburg was found guilty of assault against his 13-year-old son for beating him after catching him viewing pornographic material. In his defense, the father argued that he was administering “moderate and reasonable chastisement” previously allowed under common law. However, the Constitutional Court unanimously upheld the 2017 ruling, stating that that were effective ways of disciplining a child without resorting to corporal punishment.

“The vulnerability of children, their rights to dignity and to have the paramountcy of their best interests upheld, as well as the availability of less restrictive means to achieve discipline, render moderate and reasonable chastisement unconstitutional,” the court wrote in its ruling.

The High Court had previously ruled that spanking amounted to a violation of children’s rights, arguing that protection from all forms of violence was absolutely critical in the context of alarmingly high levels of child abuse across South Africa. The initial ruling also argued that the case was about providing children with “equal protection of the law, dignity, freedom from all forms of violence and degradation, bodily and psychological integrity, and the child’s right not to be discriminated against based on age.”

FORSA demanded the ruling be overturned, arguing that there is an obvious distinction between “reasonable” and “moderate” chastisement and unabated child abuse and that parents maintained the right to decide what was best for their children. In a statement, they said they were acting on behalf of the public interest and those who “believe that the scriptures and other holy writings permit, if not command, reasonable and appropriate correction of their children.”

Their position was opposed by various civil society groups, including the Children’s Institute, the Quaker Peace Centre and Sonke Gender Justice, who stated in written submissions that “positive parenting” was the solution to bad or disruptive behavior.

“The aim is to develop an ethos or inner conviction in the child that will ensure that they will behave well, even when their parents are not present,” they said in a written submission. “It builds feelings of confidence and assertiveness rather than feelings of helplessness and humiliation.”

Such opposition was also backed by the government, who said that children should be protected from all types of violence. “Any act that harms a child’s right to be protected from maltreatment, neglect, abuse or degradation is unlawful and unconstitutional,” said Nkosinathi Dladla, legal services director in the social development department.

The ruling now paves the way for South African parliament to draw up legislation formally criminalizing the use of physical force against children.

Follow Ben Kew on Facebook, Twitter at @ben_kew, or email him at bkew@breitbart.com.