A higher court Thursday upheld a lower court ruling that determined a legal provision that allows only men to file lawsuits denying legal paternity was constitutional, dismissing a damages suit filed by a family against the state.

The plaintiffs in the ¥2.2 million ($19,700) lawsuit — a woman in her 60s living in Kobe, her daughter in her 30s and her 4- and 8-year-old grandchildren — argued that the Civil Code provision that allows only men to deny legal paternity is discriminatory and unconstitutional.

According to the suit, the woman lived apart from her husband due to domestic violence and had a baby with a different man before their divorce was finalized. She opted not to notify authorities of the birth — required under the Civil Code — as it would have been “presumed” that the abusive husband was the biological father.

Not entering the birth in the family registry resulted in the daughter being unable to marry legally. The daughter’s two children, who were also not listed on a family registry because of her status, did not receive notifications for such things as school enrollment and public medical checkups.

The daughter and her two children were able to have their names entered on a family registry in 2016 through special court procedures after the woman’s former husband died.

But the plaintiffs said the three could have avoided being unregistered if wives and children were allowed to rebut presumed paternity under the Civil Code.

Upholding the Kobe District Court’s ruling in November, the Osaka High Court said the Civil Code provision is “beneficial to a child as it finalizes the father-child relationship at an early stage.”

Settling the legal status of a child should be prioritized over matching a biological father and the child, said Judge Toshiko Eguchi in handing down the ruling.

The high court also urged the state to address the problem of people not listed on family registries, saying it is “an issue regarding how a family should be” and the legislature should deal with the matter while taking into account tradition and public sentiment.

The paternity provision has left many women and children in legal limbo, as wives who flee domestic violence are often unable to file for divorce as they try to avoid contact with their husbands. As of Aug. 10, 715 people were not listed on family registries, according to the Justice Ministry.

The ministry began probing the issue in 2014 and instructed its legal affairs bureaus across the country in November to help such people resolve problems of legal status.