A 14-year-old boy is better off living in Sierra Leone than in the UK, a High Court judge has ruled.
The teenager was taken to Freetown as his mother was worried about his involvement in county lines gangs in London after he was excluded from school.
A civil case was brought at the High Court by her estranged husband.
Mr Justice Mostyn said the boy should stay in Freetown until the end of his GCSEs in 2022.
The father said the boy, who cannot be named for legal reasons, was now living in a country which was volatile and riven by civil strife.
But Mr Justice Mostyn "noted" the scope of the curriculum at boy's school in Freetown, adding he had no "serious concerns" about where he was living and the care he was receiving.
The boy's parents are in their 30s and from Sierra Leone, he said.
But they had both met in London, and married before separating.
Mr Justice Mostyn said by early 2019 the boy, who was living with his mother in south London, had been "going off the rails".
During last summer he had been permanently excluded from his school.
"The consequence was that he would have to complete his education at what is known as a pupil referral unit where children are placed who have been expelled from their school," said the judge.
"Unsurprisingly the mother viewed this prospect with dismay and feared that [his] education would be irretrievably impaired.
"In parallel with these events the mother gave evidence that [he] was getting involved in gang culture in his part of south London."
Mr Justice Mostyn said the woman had then decided to take her son to Sierra Leone, where her mother is a police officer, so he could continue his education in Freetown.