A Texas judge has given a relative permanent custody of a 15-year-old girl who was allegedly married to polygamist sect leader Warren Jeffs when she was 12.

The girl was the last of 439 children to remain in state custody after a massive April 2008 raid on The Yearning For Zion Ranch near the western Texas town of Eldorado.

Nearly all the children were returned to their mothers, but the 15-year-old was placed back in state custody after her mother refused to agree to some of the state's demands.

Texas District Judge Barbara Walther on Thursday signed off on giving a relative permanent custody of the girl.