HALIFAX -- An impoverished Halifax-area couple have regained custody of their toddler daughter, after a judge declared: "There is a difference between parents who are poor, and poor parents."

The province took the little girl into care in June 2016 because of her parents' multiple challenges, including mental-health issues, interpersonal conflict and unstable living circumstances brought on by poverty.

But Justice Elizabeth Jollimore said the biracial toddler was not put in a "culturally appropriate" foster home, and noted the couple have worked to improve their circumstances and relationship prospects.

"The parents cannot be faulted for their inability to afford homes in better neighbourhoods," the Nova Scotia Supreme Court judge said in a written ruling released Wednesday.

The ruling paints a picture of a young couple trying hard to overcome many obstacles.

They got together in the summer of 2015; she was 18 and learned she was pregnant by another man a few weeks into their relationship. She had struggled with mental-health issues, including self-harm.

Her 22-year-old boyfriend, shaken by his discovery of a friend's suicide, suffers from PTSD and anxiety. He was proud to have never been fired from a job, but became unemployed when his employer lost a contract in late 2015.

The boyfriend had called police several times because of conflicts and a suicide attempt by his girlfriend. At one point, she was taken into police custody after a physical confrontation between the couple.

The province took the little girl into care in June 2016. The couple had a son that December, who was also taken into care a few months later, and is now living with his paternal grandparents.

Their daughter is healthy and developing normally.

"She's described as 'very happy,' having an 'even temperament' and being 'social,"' the judge said.

The province's community services minister argued in court there is a "real chance" of harm if the girl is returned to her parents.

But the judge noted the woman has had no mental-health crises for 17 months, and previously sought help when needed. She said the woman works as a babysitter, and has extensive experience caring for five younger siblings, and is "a confident, competent and capable care-giver."

"Parents who have poor mental health are not deprived of their children: parents whose poor mental health puts their children at risk and who do not seek needed treatment are," Jollimore said in her ruling.

Meanwhile, the boyfriend had to switch to a lesser-paying job because of the court proceedings, but is a hard worker committed to providing for his family, the judge said.

"The minister said the parents' relationship is unstable. This court's docket is populated by broken family relationships. The end of a family does not necessitate the minister's involvement. The minister must point to something more," Jollimore wrote.

The couple are working on their communication skills and are taking steps to shield their daughter from their conflicts, she said.

The girlfriend had previously discussed transitioning her gender identity, which her boyfriend said would end their relationship. But she hasn't followed up since becoming pregnant.

The ruling notes the couple has moved a lot: they lived briefly with her parents after he lost his job, but the tight quarters caused conflict and they lived in a series of apartments before finally settling in a low-income area.

"It's in the context of the parents' accommodations that their poverty is conflated with being poor parents," said the judge. "The minister suggests the parents are failing for living in these homes in the first place. With limited means, the parents have limited choices."

"I conclude that the parents' housing instability does not place (the girl) at risk."