Jasper Fforde, a film technician turned writer, won the Wodehouse prize for comic fiction - plus a live pig, which is at present living unsuspectingly in a field in Powys.
Fforde beat three other writers, one of them Alexei Sayle, to an award rare in an industry which gives its big money to more lugubrious works.
His story, The Well of Lost Plots, has as its hero Thursday Next, a literary detective and expectant single mother, who spends her life hiding inside the plots of unpublished novels.
This cosy refuge is imperilled when the authorities decide to standardise grammar and punctuation and control the number of plots.
The prize is in honour of one of Wodehouse's most cherished stories, Empress of Blandings, in which Lord Emsworth's prize pig has to be coaxed into eating before a county show with cries of "Pighooooeeee".
As well as the pig, the prize includes jeroboams and cases of champagne from Bollinger, which sponsors it with Everyman.
When it was presented at the Guardian Hay festival, the festival director Peter Florence said the book "has the true Wodehousian joy of brilliant verbal playfulness, and seems genuinely and outrageously original. It's a happy marriage of delightful intelligence and complete lunacy".
The other shortlisted titles were: Penguin Lost, by Andrek Kurkov; These Foolish Things, by Deborah Moggach; and Overtaken, by Alexei Sayle.