Illegal immigrants are entitled to bring court actions against their employers for discrimination, the Supreme Court has said in a landmark judgment.

Britain’s most senior court said a young Nigerian woman who was brought to this country to work illegally when she was just 14 is entitled to protection under the law.

The decision contradicted an earlier ruling which had said that such a move would appear to “condone the illegality” of someone who had broken the law to come to Britain.

Mary Hounga arrived in Britain in 2007, when she was aged about 14, on a six month visitor’s visa by pretending to be the granddaughter of Adenike Allen, a mother-of-three who lived in London with her husband, Kunle.

Miss Hounga was promised £50 a week and the opportunity to go to school in exchange for looking after Mrs Allen’s children.

But the court heard she was abused with “violence and threats” and never received her £50 a week payment, and was ultimately thrown out by Mrs Allen in July 2008 following an argument about the children’s supper.

She was found in a supermarket car park, alone and distressed, and taken into care. Later that year she took the Allens to an employment tribunal and made a claims on a number of grounds including race discrimination and unfair dismissal.

The Nigerian partially won the tribunal against the Allens and was awarded £6,187 in compensation for “injury to her feelings”.

But that decision was set aside by the Court of Appeal in May 2012 in a ruling which also said: “The illegality of the contract of employment formed a material part of Miss Hounga’s complaint and that to uphold it would be to condone the illegality.”

A panel of five justices of the Supreme Court led by Baroness Hale, the deputy president, unanimously allowed a further appeal by Miss Hounga.

The judges said there was an “insufficiently close connection” between her immigration offences and her claim for discrimination.

The case will be sent back to an employment tribunal for a new hearing, the judges added.

Aidan McQuade, director of Anti-Slavery International which supported Miss Hounga, said it was an “historic” case.

“We are happy that the court recognised that trafficked people have the right to claim damages from their traffickers even if their status in the UK is irregular,” said Mr McQuade.

“The court emphasised that the UK needs to honour its obligations under international law and protect the rights of victims of trafficking irrespective of their immigration status.

“If someone is coerced or forced into an illegal employment, they are victims of crime and their rights should be protected.”