A court ruling that restricted the use of puberty-blocking drugs among under-16s in England has been overturned.
The High Court ruled last year that it was "highly unlikely" a child aged 13 or under would be able to consent to the hormone-blocking treatment, and that it was "very doubtful" that a child of 14 or 15 would understand the long-term consequences.
The original ruling also said that doctors "may well consider it appropriate" to get the court's approval for any puberty blocker prescription.
Now, that decision has been overturned after an appeal by the Tavistock & Portman NHS Foundation.
In a judgment on Friday, the Court of Appeal said that it was "inappropriate" for the High Court to have given the guidance, finding it is up to doctors to "exercise their judgment" about whether their patients can properly consent.
Lord Chief Justice Lord Burnett, sitting with Sir Geoffrey Vos and Lady Justice King, said in his ruling: "The court was not in a position to generalise about the capability of persons of different ages to understand what is necessary for them to be competent to consent to the administration of puberty blockers."
Lord Burnett added: "It placed patients, parents and clinicians in a very difficult position."
Launching their appeal, lawyers for the Tavistock & Portman NHS Foundation, which runs the UK's only gender clinic, said the High Court's previous decision constituted "unjustified discrimination" against transgender children.
A lawyer for Keira Bell, who brought the case after regretting taking puberty blockers at 16 and cross-sex hormones at 17, told the appeals court the previous ruling had been justified given that the drugs' long-term consequences were unknown.
She said after the ruling on Friday: "It has shone a light into the dark corners of a medical scandal that is harming children and harmed me."
Ms Bell added: "It is a fantasy and deeply concerning that any doctor could believe a 10-year-old could consent to the loss of their fertility."