A 33-year-old woman has been given a suspended sentence and barred from keeping any animal for 10 years.
Samantha Kerrigan of Spencer Road in Londonderry admitted causing unnecessary suffering to an animal on or before October 1, 2017.
The city's magistrates court heard that police were called to an address in Spencer Road after reports of a dog hanging from a first floor window. Members of the public got a ladder and rescued the dog, a female Bull Terrier.
Police forced entry into the flat and there was a strong smell of dog excreta.
The dog itself drank two litres of water in a very short space of time when given it by police and also ate food.
A vet determined that the dog was in danger of falling out of the window and had been neglected with no access to water and being left alone in the flat.
The defendant contacted police to confirm ownership of the animal but failed to attend for interview.
The court was told the dog was euthanised around a month later.
Defence solicitor Maoiliosa Barr said Kerrigan would class herself as an animal lover.
He said that Kerrigan suffered from addiction issues and added she was "barely able to look after herself, never mind anything else".
The solicitor said that the dog was supposed to go to a friend of her partner but he had been sent to prison so she had taken the dog.
He said she was "very upset" when she heard what happened to the dog.
District Judge Barney McElholm said if it wasn't for Kerrigan's health she would have gone straight to prison.
He imposed a sentence of eight months, suspended for two years, and imposed an order barring her from keeping any animal for 10 years.