Massachusetts’ highest court ruled on Tuesday that an unmarried gay woman who raised two children with her then girlfriend, who became pregnant through artificial insemination, can seek full legal parental rights.

The former couple, Julie Gallagher and Karen Partanen, were together, but unmarried, from 2001 until 2013. Partanen was present when Gallagher gave birth to a daughter in 2007 and a son in 2012, Beacon Hill Patch reports.

The Supreme Judicial Court, which also made the state the first in the country to legalize same-sex marriage in 2004, after its landmark Goodridge v. Department of Public Health ruling in 2003, overturned a previous decision by a family court judge.

That judge had ruled that she didn’t meet the requirements under state law because she and Gallagher were not married when the children were born, and Partanen is not a biological parent.

Partanen was represented by GLBTQ Legal Advocates & Defenders, the same legal group that brought the gay marriage case.

Mary Bonauto, the group’s civil rights project director, called the ruling “a major victory for contemporary families.”

“It is especially a victory for the children in those families who should not be deprived of their parents because those parents are not married or used assisted reproduction,” Bonauto added.

The case now goes back to family court, where Partanen can pursue her claim for full parentage, which would allow her to have a say in important decisions about how the children are raised.

Gallagher’s lawyer, Jennifer Lamanna, told the Associated Press her client can still contest the claims to parentage made by Partanen but that she has not yet decided if she will do that.

Gallagher said in an interview in April that Partanen had been a good parent and that she would never try to remove the children from her life. They currently spend half their time with Partanen under a shared custody order.

While the court acknowledged that Partanen had never adopted the children, it pointed out that she had raised them from birth, including “waking for night-time feedings, bathing, meal preparation, grocery shopping, transportation to/from day care and school, staying home with the children during times illness, clothes shopping, providing appropriate discipline as necessary, addressing their developmental needs, [and] comforting” them.

More than 35 states confer parentage on spouses who consent to assisted reproductive technology, as Partanen did, the AP reports. Seven of those states and the District of Columbia give legal parentage to the person who consents to the procedure with the intent to parent the resulting child, without regard to marital status, according to fertility associations and attorneys who submitted written arguments supporting Partanen.