A writer whose novel was inspired by the death of her son from a congenital heart condition has won one of the top literary prizes in the UK.

Ann Kelley's The Bower Bird, published by Edinburgh's independent Luath Press, yesterday won the children's book category in the prestigious Costa Book Awards, previously known as the Whitbread prizes.

The win for Luath Press marked a strong Scottish presence in the awards, with AL Kennedy, the Glasgow-based writer, winning the best novel award for her latest book, Day, which the judges said was a "masterpiece".

Kelley's story was partly inspired by her son, Nathan, who was born with a congenital heart and lung condition.

He spent his childhood battling his illness, and died aged 24, a week after an organ transplant operation.

The main character in The Bower Bird is Gussie, a spirited 12-year-old who suffers from the same condition and is waiting for a heart transplant.

Kelley, 66, who lives in St Ives, Cornwall, and also has a daughter, Caroline, said she was astonished by the prize.

She said: "I am very excited and amazed. Gussie has the same condition that my son had and like him she is a complete one-off, although perhaps in a different way. She has a great love of life like he had.

"I was born in Yorkshire but I went to school in Thurso, indeed that's where I learned to read, so this is all Scotland's fault."

When her son was born, doctors said he would not survive the week, and later warned that he would never walk. But he defied both predictions and became an accomplished student, going on to study space sciences at university, despite suffering a heart attack at 13 and a mild stroke while sitting his A-levels.

In December 1985 he received an organ transplant but never regained consciousness and died a week later.

Kelley, who failed her English Literature O-level at school in England, began writing poetry about her son following his death.

In 2005 she published her debut novel, The Burying Beetle, in which she introduced the character of Gussie. The Bower Bird is the follow-up which came out last year.

Luath Press is one of Scotland's leading independent publishers of new fiction and poetry. Recently Mr MacDougall revealed that Ms Kelley was discovered by an eager work-experience student about three years ago.

"The work-experience girl had been going through manuscripts that hadn't been read yet and found Kelley's first novel," he said. "She told us, Of all the things I've read here, you must publish this one, it's absolutely one to follow up,' which we duly did."

The judges said of Kelley's book: "The world of life and death, beauty and truth seen through the eyes of a 12-year-old girl - a rare and beautiful book of lasting quality - we felt this is a voice that needs to be heard and read."

Elsewhere in the awards a former postwoman whose debut novel was rejected 15 times, Catherine O'Flynn, won the First Novel Award for What Was Lost.

She worked as a postwoman and box office assistant while writing the book - the story of a security guard who spots a child on CCTV 20 years after she disappeared - only to see it turned down by publisher after publisher.

It was finally picked up by Birmingham-based Tindall Street Press and went on to be nominated for the Man Booker Prize and the Orange Broadband Prize for Fiction.

Each of the winners in the Costa awards receives £5000, and will go on to compete for the £25,000 overall Costa Book of the Year, to be announced on January 22.

Simon Sebag Montefiore's acclaimed study, Young Stalin, won the Biography Award, while Jean Sprackland picked up the Poetry Award for Tilt, her third collection.

The Costa Book Awards, formerly the Whitbread Book Awards, were established in 1971 to encourage, promote and celebrate the best contemporary British writing.

John Derkach, the managing director of Costa said: "We're very proud to be announcing such an outstanding collection of books."