A German court has convicted two Romanian men of killing a goat at a petting zoo, following a trial in which the defendants testified that they had been hungry.

News agency DPA reported that a Berlin district court convicted the 29-year-olds on Wednesday of theft and killing an animal without good reason.

One of the men, who had a previous conviction for theft, was sentenced to 10 months in prison and his accomplice to nine months.

The pair broke into the petting zoo in Berlin’s Hasenheide park in February and killed “Lilly”, the Angora goat.

They were caught by police, who had been alerted by a witness. One of the men had a knife, and officers also found a rucksack containing a goat’s leg and bloody gloves.

During the trial, the men said they slaughtered the goat because they had not eaten for days, the Berlin Morgen Post reports.

They had arrived in Berlin in January and found jobs as building workers but had not been paid, the court heard.

The men, who have not been named, told the court they believed the petting zoo was a farm.