A Calgary provincial court judge has upheld a city bylaw making it illegal to keep chickens in a backyard coop.

Keeping chickens inside the city limits has been a dispute that’s gone on for years.

Paul Hughes is the president of the Calgary Liberated Urban Chicken Klub, otherwise known as CLUCK and has been raising chickens in his Killarney yard.

Hughes was ticketed for keeping the birds under the city's responsible pet ownership law.

He challenged the bylaw back in 2009 claiming the prohibition violated the charter of rights.

On Wednesday, a Calgary judge disagreed and ruled that the bylaw does not violate his rights.

"I have to respect the courts, that's how Canadians, how we make decisions and I went to the courts for a decision. I'm not happy. Nobody likes to lose and I'm a little bit shocked by the decision," said Hughes.

Hughes was sentenced to one day in jail but will not serve it as the the prosecution did not ask for a penalty in the case.

He says his chickens are being cared for by someone else in the city and he is planning an appeal.