The American author Joshua Ferris has won the International Dylan Thomas prize for his darkly comic novel about a New York dentist grappling with an existential crisis.

In celebration of the legacy of the Welsh poet and writer, the annual award is given to the “best literary work in the English language, written by an author aged 39 or under” – marking the age Thomas was when he died. In previous years, the award, worth £30,000 to the winner, was given to the best writer under 30.

To Rise Again at a Decent Hour, which was also shortlisted for this year’s Man Booker prize, fought off tough competition from last year’s Man Booker winner, 28-year-old Eleanor Catton’s novel The Luminaries, and Irish writer Eimear McBride’s book A Girl is a Half-Formed Thing, which has already won the Bailey’s prize for women’s fiction.

The book, Ferris’s third, was praised by the judges as a “novel which encapsulates the frustration, energy and humour that goes into the making of New York”.

It tells the story of Paul O’Rourke, a dentist, baseball obsessive and owner of an upmarket dental practice on Park Avenue who discovers someone is impersonating him online and claiming he is descended from a Biblical tribe called the Amalekites.

Released in May, the novel was described by the Guardian as “enormously impressive: profoundly and humanely engaged with the mysteries of belief and disbelief, linguistically agile and wrongfooting, and dismayingly funny in the way that only really serious books can be”.

Peter Stead, founder and president of the Thomas prize, which is now in its ninth year, said: “Ferris’s book, about a New York dentist faced with the frustration of his job, his sexual relationships and his identity, is drawn into a wider world in which he discovers the role of electronic media and mysterious religious cults in shaping not only his life, but also his identity.”

His comments were echoed by Peter Florence, chair of the judging panel and founder of the Hay literary festival, who praised the unique humour of Ferris’s writing. “People who can make comedy from human tragedy are rare and wonderful,” he said. “It’s an incredibly hard thing to do and takes a kind of genius to deliver it on the page.”

Ferris, 39, has already been the recipient of the PEN/Hemingway award for his highly acclaimed debut, Then We Came to the End, and in 2010 was included in the New Yorker’s “20 Under 40” list of fiction writers to watch.

Ferris was presented with the award, along with a bronze bust of Dylan, at the birthplace of the poet in Swansea, as part of a series of celebrations marking the centenary of the Under Milk Wood author’s birth this year.

Other works that missed out on the prize this year included the Forward prizewinning poetry collection, The Cartographer Tries to Map a Way to Zion by Jamaican-born Kei Miller, Welsh playwright Owen Sheers’ play Mametz, author Naomi Wood’s novel Mrs Hemingway, and Kseniya Melnik’s Snow in May, a novel set in eastern Russia.