ALBANY, N.Y. (CBSNewYork/AP) — New York’s highest court has expanded the definition of parenthood by ruling Tuesday that former same-sex couples have the right to seek visitation and custody of children even when they aren’t the biological or adoptive parent.

The Court of Appeals decision resolves two cases of former unmarried same-sex couples in which the biological mothers kept the children and their ex-partners sought legal standing to see them. In one case, lower courts ruled the ex-partner had no standing. In the other, the ex-partner pays child support and was later granted visitation.

READ MORE: Viral Video Shows Unmasked NYPD Officer Pushing Masked Commuter Out Of Subway Station

A 25-year-old definition of parenthood required a person seeking custody or visitation to have a biological or adoptive connection to the child. In its decision, the court stated that that standard had become “unworkable” in light of society’s “increasingly varied familial relationships.”

“Where a partner shows by clear and convincing evidence that the parties agreed to conceive a child and to raise the child together, the non-biological, non-adoptive partner has standing to seek visitation and custody under Domestic Relations Law,” reads the opinion written by Judge Sheila Abdus-Salaam.

New York began recognizing same-sex marriages in 2011, and any children born into a marriage are considered the children of both parents. But the law was far murkier when it came to same-sex couples who had a child before the law was enacted — or who have foregone marriage. Same-sex partners often found it impossible to seek visitation or custody over a non-biological child they had not adopted if the relationship ended.

“We have seen a trail of tears in New York involving these types of situations,” said Susan Sommer, senior counsel at Lambda Legal who worked on the case on behalf of a woman who sought joint custody and visitation rights over the son from her previous relationship. “Until now, the court’s hands were tied. This allows a far more humane New York.”

READ MORE: Hip-Hop Improv Show 'Freestyle Love Supreme' Returns To Broadway

The ruling will also apply to heterosexual, unmarried couples — meaning an ex-partner could petition for visitation or custody of a child created through artificial insemination if they can show they and their former partner intended to co-parent the child.

“Today’s decision reverses a dire situation for all too many children and their parents who had been denied any ability to protect their relationship simply because they were not biologically related to each other,” Sommer told 1010 WINS.

Sommer’s client, identified in the court papers by the name and initials Brooke S.B., began a relationship with her ex-partner in 2006 and the two soon planned to have a child through artificial insemination. In 2009, Brooke’s partner delivered a baby boy, who was given Brooke’s last name and raised jointly by the two women until 2010, when the relationship ended. Brooke was allowed to regularly see the child until 2013, when Brooke’s ex ended the visits. Lower courts had ruled that Brooke had no right to custody or visitation because there was no biological or adoptive relationship.

In the other case, the two women agreed to have a child and raise her jointly before breaking up when the girl was six. The child remained with the birth mother while the two women filed legal actions over child support and visitation.

“This decision brings New York into line with the mainstream view that parental status may be established based on a couple’s decision to co-parent and the reality of the parent-child relationship and not just biology or legal adoption,” said attorney Jeffrey Trachtman who represented the woman who won the case, Estrellita A. “It eliminates a rigid rule that unnecessarily harmed thousands of children and parents by denying the reality of their relationships. And it correctly reads the triumph of marriage equality as reflecting a strong societal shift towards respect for the families formed by same-sex couples.”

Christopher Chimeri, the attorney for the birth mother in the second case, said that while his client is personally disappointed, she accepts the decision.

MORE NEWS: Eligible New Jersey Residents Urged To Get COVID Booster Shot

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)