JK Rowling (left) lodged an appeal after losing a High Court case last year
Harry Potter author JK Rowling has won a legal battle to ban publication of long-lens photographs taken of her son when he was 18 months old.
The author claimed the boy's right to privacy had been infringed after a picture of him was published in 2004.
The case went to the Court of Appeal after she lost an action last year.
Ms Rowling, 42, said she had taken action because she wanted her children to grow up "free from unwarranted intrusions into their privacy".
The writer brought the case against photo agency Big Pictures under her married name Mrs Joanne Murray.
She and her husband Dr Neil Murray released a statement after the ruling, saying: "We understand and accept that with the success of Harry Potter there will be a measure of legitimate media and public interest in Jo's professional activities and appearances.
"However, we have striven to give our children a normal family life outside the media spotlight.
"We are immensely grateful to the court for giving our children protection from covert, unauthorised photography; this ruling will make an immediate and material difference to their lives."
The agency photo - taken in November 2004 - showed Ms Rowling pushing David in a buggy on a street in Edinburgh.
The picture was published in the Sunday Express and the newspaper later settled the claim.
Judge Sir Anthony Clarke said: "If a child of parents who are not in the public eye could reasonably expect not to have photographs of him published in the media, so too should the child of a famous parent.
"In our opinion, it is at least arguable that a child of 'ordinary' parents could reasonably expect that the press would not target him and publish photographs of him."