Two authors have declared that young readers “don’t need happy endings” after winning the UK’s most prestigious children’s book awards with dark works about a boy held hostage and a doomed fish.

Kevin Brooks, who struggled to get The Bunker Diary published for a decade because of its dark subject matter, was awarded the Cilip Carnegie Medal – a prize previously won by Terry Pratchett and Neil Gaiman.

At yesterday’s awards ceremony, at the Unicorn Theatre in London, Jon Klassen became the first Canadian to win the Cilip Kate Greenaway Medal, for illustration, for his book This is Not My Hat.

Download the new Independent Premium app Sharing the full story, not just the headlines

Following the awards – for books with “unusually dark finales”, according to the judges – both said that children “benefit” from books without happy endings.

Helen Thompson, chair of the judging panel, said children and teenagers “live in the real world; a world where militia can kidnap an entire school full of girls and where bullying has reached endemic proportions on social media”.

The Bunker Diary is the fictional tale of a boy “who’s had a lot of problems” and is held hostage in a bunker, which was rejected by publishers for 10 years for its “lack of hope”.

Brooks said: “There is a school of thought that no matter how dark or difficult a novel is, it should contain at least an element of hope. As readers, children – and teens in particular – don’t need to be cosseted with artificial hope that there will always be a happy ending.”

He had no doubt it would have been published years earlier “if I’d rewritten it – toned it down, changed the ending, explained a lot of unexplained things – but that would have meant writing a different book”.

Brooks, previously shortlisted for the award on three occasions, added: “I never had any doubts that kids could deal with this, they just have no problem with complex serious stuff.”

This is Not My Hat, aimed at kindergarten-age children, tells of a thieving fish who gets his comeuppance. Klassen said that as a storyteller he had to “try to make sure it ends the way the story should end.

“You can do almost anything with kids’ books if you do it right,” he said. “You don’t want to avoid certain plots, you just tell them in a certain way.”