A top South African court has cleared the way for an eight-year-old girl, born to Cuban parents, to be granted South African citizenship.
This entitles her to access to health care, education and other welfare services which she had been denied.
As her parents have been out of Cuba for some time, the girl had been unable to claim Cuban citizenship and she had been effectively left "stateless".
This test case will affect other children in such legal limbo.
The case has been going through the South African courts for several years, and the Supreme Court of Appeal's decision came after the government challenged a ruling brought by a lower court.
The BBC's Karen Allen in Johannesburg says the home affairs ministry had argued that granting the girl a South African birth certificate would open the floodgates to new applications.
The court's judgement is a reaffirmation of existing laws in South Africa which give citizenship to stateless children.
The Supreme Court of Appeal gave the government 18 months to get its house in order and put in place a mechanism for processing similar claims.
Lawyers say the implementation of this ruling would bring South Africa into line with many other countries.
It could also help many of the thousands of stateless youngsters born in South Africa, who are now being put up for adoption and whose birth parents were foreign migrants or refugees, our reporter says.
A spokesman for South Africa's Department of Home affairs said it welcomed the chance to re-evaluate its position.
South Africa is home to many African migrants who have moved to the country for better economic fortunes in one of the continent's largest economies or to seek political refuge.
Latest Stories
-
Fuel supply, financial challenges top priorities for energy sector – John Jinapor
2 minutes -
We won’t engage in sole sourcing for ECG private sector participation – Energy Minister-designate
8 minutes -
Photos from John Jinapor’s vetting for Energy Minister role
22 minutes -
Public procurement and corruption in Ghana: Challenges and sustainable solutions
32 minutes -
Seize campaign activities, work on rebuilding party – NPP Council of Elders tells members
49 minutes -
We don’t intend to privatise VRA and Bui Power – John Jinapor
54 minutes -
Import substitution strategies in the 24-Hour Economy: A catalyst for Ghana’s practical economic growth
1 hour -
Chamber of Aquaculture urges President Mahama to nominate a Minister with agribusiness expertise
2 hours -
Energy Minister-designate sets 6-months for ECG private sector involvement framework
2 hours -
Mahama should scrap deputy ministerial position for tourism
2 hours -
Global economy remains resilient, to grow by 3.2% in 2025 – OECD
2 hours -
I’ll focus on the development of the real sector – Dr Ato Forson
2 hours -
Energy sector debt has ballooned to $3bn – John Jinapor
2 hours -
Businesses to see tax reliefs as Ato Forson promises VAT reforms
2 hours -
PUWU reaffirms opposition to ECG privatisation
2 hours