Author Iain Banks.
Banks announced he was suffering from gall bladder cancer in April and said he asked his partner, the author Adele Hartley, if "she will do me the honour of becoming my widow" – the ghoulish humour, he explained, helped them cope with his impending death.
The announcement triggered tributes from his army of fans who followed the prolific writer since he made his literary debut in 1984 with The Wasp Factory.
Announcing his death at the age of 59, publisher Little Brown said Banks was an irreplaceable part of the literary world.
"Just three weeks ago he was presented with finished copies of his last novel, The Quarry, and enjoyed celebration parties with old friends and fans across the publishing world," the publisher said in a statement.
Banks began writing the book after he was diagnosed with gall bladder cancer in March.
The novel, to be published on June 20, describes the final weeks in the life of a man in his forties battling terminal cancer who is being cared for by his 18-year-old son Kit.
Early reviews said Banks's instinct for fierce black comedy and biting dialogue remained as sharp as ever.
Politics and passions
Born in Fife, Banks was an only child in a household full of books. His parents encouraged him to develop a fantasy life.
He knew from an early age that he wanted to be a writer, completing his first unpublished novel at the age of 16.
After the success of The Wasp Factory, Banks began to write full-time and agreed with his editor to try and produce a book a year, pursuing two writing careers – as Iain Banks the mainstream fiction writer and as Iain M Banks, the science-fiction writer who emerged with Consider Phlebas in 1987.
The first Iain made more money from his books, which included The Crow Road and Complicity, and received the greatest literary praise. The second Iain (with an M) was more political and had a loyal cult following.
Banks, a larger-than-life character who wore his politics and passions on his sleeve, once joked that he had considered adding a few more pseudonyms to the list, writing westerns as Iain Z Banks and erotica as Iain X Banks.
Proud of his Scottish heritage, Banks revelled in his love of malt whisky, even making it the subject of a book Raw Spirit that took him across Scotland.
But after hitting 50 and with the collapse of his first marriage in 2006 he took stock of his life and made changes.
Giving up alcohol and drugs
The man who once ran for rector of the University of Edinburgh on behalf of the Drunken Bastards Party cut back on his drinking and also gave up recreational drugs after years of marijuana, LSD and cocaine use.
"I always drew the line at heroin, that stuff is just stupid," Banks told the Australian in 2008.
In a bid to reduce his carbon footprint he decided to avoid long haul flights and traded in his beloved sports cars – a Jaguar, Porches, BMW and a Land Rover – for something greener.
"I miss the cars a lot. I finally cracked and bought a Mini soft top because it's green and it's got the smallest engine," he said.
For several years he had trouble travelling because he tore up his passport in protest of the Iraq war in 2007, refusing to apply for a new one until Prime Minister Tony Blair left office.
Fans of the author tweeted their condolences on Sunday.
"Rest in peace Iain Banks. Such sad news," wrote cyclist Chris Hoy, Britain's most successful Olympian.
Fellow author Neil Gaiman tweeted: "Iain Banks is dead. I'm crying in an empty house. A good man and a friend for almost 30 years." – Reuters