A 72-year-old woman jailed for hugging her granddaughter in breach of an order banning contact, after Derbyshire County Council alleged she breached court orders, was freed by a judge.
Kathleen Danby appeared in custody to make a case against her three-month jail sentence, handed down earlier this year at Birmingham's Court of Protection.
In April, a judge sent the pensioner to prison in her absence after watching CCTV evidence of her greeting the teenager, who cannot be named for legal reasons, with a hug outside a pub.
Reducing the sentence of Mrs Danby, of Orkney, to time already served, Judge Sally Dowding said: "I am satisfied she fully appreciates the difficulties of her position and what she must do, and I am confident she will comply in future."
Mrs Danby's solicitor, Sarah Huntbach, said her client, dressed in a large red overcoat, "sincerely apologised" for being in the town where her granddaughter now lives.
She said the pensioner was there for the day "to meet a friend" and, as she waited outside a pub, her granddaughter - who has a learning disability and emotional difficulties - approached her.
"She did not intend or want to be in breach of these (court) orders, or dishonour the court in any way", said Mrs Huntbach.
While not accepting that she intended to meet her granddaughter, Mrs Danby "apologised for any nuisance that has arisen as a consequence".
Judge Dowding said it was "very sad" that Mrs Danby had "failed to comply" with the court orders, which evidence showed had had "a detrimental effect" on the granddaughter's behaviour, "with consequences serious and profound".
However, she said it was Mrs Danby's right "to purge her contempt" before the court.
The spirited pensioner has been in custody since her arrest on Sunday in Liverpool, where she had been enjoying a performance by comedian Ken Dodd.
She was escorted in to court by four security officers, and wearing handcuffs, but smiled and looked around as she entered.
Contempt of court proceedings were brought against Mrs Danby by Derbyshire County Council, which is responsible for looking after the 19-year-old.
The local authority had alleged the pensioner was in breach of court orders made in September 2013, January, and April 2014.
The orders banned the frail Mrs Danby from any communication, save a single supervised monthly phonecall, or visiting the granddaughter's home town, college, or going within 100 metres of the girl.
Mrs Dowding said she noted the judgment of Judge Martin Cardinal, in April, who had been satisfied Mrs Danby "had engineered a meeting" with the granddaughter - named as 'B', despite what the pensioner's solicitor had said in mitigation.
"There is very clear evidence these events brought about a detriment in B's behaviour and the consequences were serious and profound," added Mrs Dowding. She said it had never been the case the local authority was "seeking to isolate the child from her family", pointing out that the granddaughter's maternal family "have regular contact".
Outside court, a defiant Mrs Danby said she had been through "a humiliating ordeal", which had seen her "bundled" from a Ken Dodd concert and latterly locked up in prison.
Asked if she had been scared in jail however, she laughed, replying: "No, I wasn't scared. I don't scare easily."
She described how the day after her arrest she was taken to the Birmingham court for what was apparently to be the sentencing review hearing, but claimed when she got there accompanied by security officers, "nobody knew what was going on".
"I was sat there for three hours, wasting my time," said Mrs Danby.
"Then a lady came from the court and said 'Mrs Danby wasn't supposed to be taken here, she was supposed to be taken to (HMP) Foston Hall (in Derby)'.
"So, this is then a 200-mile journey, so they took me in a rickety old van, while I was suffering a loss of sleep."
Once at the all-women prison, she was allocated a cell and then claimed the medication she needs to treat her liver disease was taken off her because it could not be identified.
She said it was not until almost 24 hours later, she was allowed back her pills.
Summing up her experience, Mrs Danby said she had been "strung along", and prevented from speaking to her son since the night of her arrest in Liverpool on Sunday.
"It is very difficult because I cannot believe they'll go to these lengths to pursue a 72-year-old woman who's got a liver disease, just in order to keep control over my granddaughter, which is what they're trying to do," said the pensioner.
"I can't tell you any more about my granddaughter."
Asked about what her views were on the county council's decision to apply for contempt of court proceedings in the first place, she replied: "Your really don't want to know - there aren't words to describe what I think of Derbyshire County Council."