He beat four other writers including bookmakers' favourite, Edinburgh based author Kate Atkinson.
Novelist Rose Tremain, who chaired the judging panel, said it was "astonishingly sure-fitted" for a first novel.
Filer's work as a mental health nurse is central to his award-winning debut.
The 32-year-old is now a lecturer in creative writing at Bath Spa University and a film-maker, but worked for many years for the mental health service in Bristol where he still lives.
His novel - the story of two brothers torn apart by a tragic accident and the slow descent of one into schizophrenia - started as a short story.
But he developed the book and the subsequent novel sparked a publishing bidding war when it first appeared and was reportedly snapped up in a six-figure deal.It is the first time a debut novel has won the prestigious prize since Stef Penney's The Tenderness of Wolves in 2006.
Filer, who said he felt "a bit emotional" accepted the £30,000 prize at a ceremony in central London and said it was "a real honour" to have been nominated with the other books.
Ms Tremain said the book, about two brothers torn apart by a tragic accident and the slow descent of one into schizophrenia, was about grief.
She said: "This is a subject which we all have experience of and it is grief analysed but treated absolutely without sentimentality".
She compared the book to Mark Haddon's best-seller The Curious Incident of the Dog in the Night-time, saying there had been "much discussion" about the other books in contention but said Filer's book "stood out in an exceptional way".
She said: "As we know the Costa Prize is important and this is going to change this person's life".
A spokesman for booksellers Waterstones said: "This is a real giant killer of a winner, and shows the Costa is as exciting as the other major literary prizes. While The Pike was a strong second favourite, the Costa does not favour biography so the smart money was on Life After Life.
"But Atkinson's was not the only book people were reading and, essentially, talking about in 2013. This will make The Shock of the Fall a major best seller, and put its multi-talented author firmly on the literary map."