Non-EU citizens may have the right to residence in the EU if their children are EU citizens, the European Court of Justice (ECJ) has ruled.
It made the judgement in the case of a woman from Venezuela who had a child with a Dutch citizen from whom she has since legally separated.
She was denied social welfare and child benefit payments by Dutch authorities.
The rights of non-EU citizens in the EU have come to the fore as Britain prepares to negotiate to leave.
The European Union says questions about the status of Britons in the remaining 27 EU countries, and of those countries' nationals in the UK, must be resolved as a priority in negotiations.
The ECJ's "interference" in national court judgments about migration was cited by some who advocated for the UK to leave the EU.
Wednesday's ruling concerned a Venezuelan national who came to the Netherlands on a tourist visa.
In 2009, she had a child with a Dutch national with whom she lived in Germany until their separation in 2011, when she and the child left the family home and she became responsible for care of her daughter without support from the father.
But because she did not have a right to residence, Dutch authorities rejected the mother's application for welfare payments.
But the ECJ has now ruled that EU law does not allow a member state to take decisions which block the legal rights of a family member of an EU citizen - in this case, the woman's child, who is a Dutch citizen via her father.
The court argued that any threat to the mother's right to remain in the EU would deprive the child of the "genuine enjoyment" of her own rights under European law.
The ruling applies to cases where the child has a relationship of dependency on a parent which means the child would have to leave the territory of the EU if the parent did. That would require assessment of a number of factors including age, the child's development and its emotional ties to each parent.
It is now left to the Dutch courts to make a final decision on the individual case involving the family in the light of the decision handed down by the European judges.
On Thursday afternoon, the European Parliament will hold a hearing into the rights of EU citizens in the UK.