Karunatilaka's book is set in the 1990s and is about a gay photographer who wakes up dead during the country's civil war.
Maali Almeida then has seven moons to reach out to loved ones who can find his pictures that document the atrocities of the civil war.
Neil MacGregor, chair of the judges for this year, said the book is a "metaphysical thriller, an afterlife noir that dissolves the boundaries not just of different genres, but of life and death, body and spirit, east and west."
MacGregor added the book was an entirely "philosophical romp" and won because of "the ambition, the scope and the skill, the daring, the audacity and the hilarity of the execution."
Karunatilaka, who won 50,000 pounds ($57,000; €57,875) in prize money along with the award, said he hoped that his book would be found in the "fantasy section of the bookshop and will... not be mistaken for realism or political satire."
The Sri Lankan author accepted his award from Camilla, the Queen consort. Karunatilaka's prize-winning book was published by Sort of Books, which is an independent British publishing house.
Who is Shehan Karunatilaka?
Karunatilaka was born in Galle in southwestern Sri Lanka in 1975, and grew up in capital Colombo. He has written for many international publications and lived and worked in London, Amsterdam and Singapore.
He lives in Colombo today and cites Kurt Vonnegut, Nick Hornby and William Goldman as among his favourite authors.
The Sri Lankan writer first gained literary attention a decade ago, with his debut novel Chinaman in 2011.
The Booker Prize
The shortlist for this year's Booker Prize award also included British author Alan Garner's "Treacle Walker," Zimbabwean author NoViolet Bulawayo's "Glory" and American author Percival Everett's "The Trees."
Earlier this year, Geetanjali Shree won the International Booker Prize for her Hindi-language novel "Tomb of Sand."
It was the first book in any Indian language to clinch the prize, which honors international translated fiction. She was picked from a shortlist that included five women authors.
The Booker Prize: The winners who changed literature
The Booker Prize has been called the Oscars of world literature. From 1997 winner Arundhati Roy to 2020 surprise recipient Douglas Stuart, here's a list of celebrated winners.
Image: Picture-Alliance /dpa/Photoshot
Arundhati Roy - 'The God of Small Things' (1997)
Arundhati Roy took the literary world by storm in 1997 with her story of fraternal twins Rahel and Estha coming of age amid political turbulence in Kerala in Southern India. Against the backdrop of their struggling blind grandmother's factory, the story set in the late 1960s dwells on India's entrenched caste society, its religious diversity and complex social hierarchies.
Image: Picture-Alliance /dpa/Photoshot
Michael Ondaatje - 'The English Patient' (1992)
Michael Ondaatje’s celebrated 1992 Booker-winning novel explores four lives that intersect in an Italian villa as World War II draws to an end and bombs fall on Hiroshima. An exhausted nurse, a maimed thief and a wary military engineer are haunted by the English patient upstairs, who is burned beyond recognition. The novel was adapted into a 1996 film that won nine Oscars.
Image: Imago/ZUMA Press/R. Tang
Margaret Atwood - 'Blind Assassin' (2000)
The Canadian author might be best known for "The Handmaid's Tale" (1985), but "The Blind Assassin" won her the Booker prize in 2000. "A multilayered drama that weaves its narrative threads across past and present, fiction and reality," said the jury of this iconic story about an aging woman who reflects on her sister's mysterious early death and the resulting scandal.
Image: picture-alliance/dpa/D.Calabrese
Hilary Mantel - 'Bring up the Bodies' (2012)
The sequel to Hilary Mantel's Tudor England historical novel "Wolf Hall" (also a Booker winner, making her the first woman and British author to win twice), "Bring Up the Bodies" sees Anne Boleyn, for whom Henry VIII broke with the Catholic Church, fail to bear a son to secure the Tudor line. The king’s chief minister, Thomas Cromwell, must now find a solution to secure his own future.
Image: AP
Richard Flanagan - 'The Narrow Road to the Deep North' (2014)
Set in a Japanese prisoner of war camp, the Australian author's historical novel was a brutal depiction of the infamous Thailand-Burma Death Railway during World War II. It centers on an Australian surgeon in the camp who remains haunted by his affair with his uncle's young wife as he struggles to save men from starvation, cholera and torture.
George Saunders - 'Lincoln in the Bardo' (2017)
American short story writer George Saunders' first full-length novel, "Lincoln in the Bardo," was an experimental work that was praised by the judging chair for "its innovation ... the way in which it paradoxically brought to life these almost-dead souls." It sees President Abraham Lincoln visit the body of his 11-year-old son, whose soul still lives on, in a Washington cemetery in 1862.
Image: picture-alliance/ZUMAPRESS/R. Tang
Bernardine Evaristo - 'Girl, Woman, Other' (2019)
"With vivid originality, irrepressible wit and sly wisdom, Bernardine Evaristo presents a gloriously new kind of history for this old country," wrote the Booker Prize jury of the first Black writer to win the prize (shared with Margaret Atwood for "The Testaments"). The novel traces the lives of 12 mostly women and Black people coming of age in the UK across diverse generations and social classes.
Image: picture-alliance/Photoshot
Douglas Stuart - 'Shuggie Bain' (2020)
It took 10 years to write and was rejected 32 times before it was finally published. Yet the 2020 Booker Prize jury needed just an hour to pick Douglas Stuart's "Shuggie Bain" as the winner from six shortlisted works. "I am absolutely stunned," said Stuart. The debut novel draws on his own life growing up gay in impoverished Glasgow in the 1980s while struggling with his mother's alcoholism.
Image: Grove/AP/picture alliance
Damon Galgut - 'The Promise' (2021)
It was third time lucky for South African author Damon Galgut. Shortlisted in 2003 and 2010, he won in 2021 for "The Promise," beating out one other previously shortlisted author, Richard Powers. The novel tells the story of a white South African farming family across four decades and the failure to fulfill the matriarch's dying wish — to gift a house on the property to a Black woman worker.