The Diet passed a law on Friday that recognizes married couples who have children through donated eggs and sperm as legal parents.

The amendment to the civil law, which both ruling and opposition parties supported, will come into effect a year after it is promulgated.

The rules for the recognition of legal parents under the current civil law date back more than 100 years and lack provisions regarding artificial insemination or in vitro fertilization using donors.

There have been discussions about how to eliminate legal uncertainties regarding the parentage of children born as a result of such assisted reproduction technologies.

The new law stipulates that a woman who gives birth using a donated egg is the child's mother, and not the donor. It also says a husband who consents to his wife giving birth with donated sperm will be unable to deny that he is the child's father.

It does not, however, give children the right to seek disclosure of the identities of the egg or sperm donors, an omission that has been met with criticism from groups representing them.

The legislation also doesn't cover some other issues such as the buying and selling of eggs and sperm, as well as regulations on commercial surrogacy services. It says legal measures will be considered to address those issues over the next two years.