VANCOUVER — A judge has ruled that an Alberta couple cannot adopt a little girl who has been in their care for more than five years because they are not British Columbia residents.

B.C. Supreme Court Justice Barbara Young says in a decision released online Friday that the director of adoption erred when she placed the girl, who is now six, with the Alberta family who was already caring for the her half-sister.

The girl’s biological father argued that the director did not have the authority to place the girl with the family because legislation governing adoptions in B.C. says prospective adoptive parents must be residents of the province.

The director argued the purpose of the legislation is to create a new, permanent family that is in the best interests of the child.

Young disagreed, saying once a child is placed for adoption outside of the province, the director no longer has control, which is important in case the adoption does not work out.

She ruled the director cannot consent to the Alberta family adopting the girl, but that the child should stay with them until further orders from the court.