It was perhaps apt that, in announcing his own imminent death, Iain Banks published a devastating passage of prose laden with quiet pathos, ghoulish humour, and a little grit.

The Scottish author, a master of conjuring plots and characters, has stunned the literary world and his many thousands of fans by revealing he is battling cancer.

The personal statement began, almost lightly, by noting that the writer, 59, is "officially Very Poorly".

Banks went on to explain that he has cancer in his gall bladder, liver, lymph nodes and probably his pancreas.

He said: "I'm expected to live for 'several months' and it's extremely unlikely I'll live beyond a year."

His latest novel, The Quarry, which he has just completed, will be his final book.

Banks, who lives in North Queensferry, Fife, said he has now married his partner Adele.

"I've asked ... if she will do me the honour of becoming my widow," he said with typical ghoulish humour.

After a short honeymoon, the couple will see friends, relations and places that mean a lot to them.

Authors, fans, literary festivals and institutions paid tributes and expressed their sadness and loss yesterday.

First Minister Alex Salmond said: "Iain Banks is a remarkable writer who has made a lasting contribution to Scottish literature and culture, inspiring and enthralling readers for 30 years.

"My thoughts are very much with Iain, his wife and family and his friends at this very difficult time."

Banks's novels include Espedair Street, Complicity and The Crow Road, which variously were adapted for radio, television and film.

He writes highly praised science fiction, under the name of Iain M Banks, and was recently named as one of the 50 greatest British writers since 1945.

His Culture books, the first of which, Consider Phlebas, was published in 1987, are considered among the best works of modern science fiction.

Stephen Fry, the writer and actor, said: "So devastated by the sad sad news about Iain Banks – he and Iain M Banks, his sci-fi alter ego, two of my favourite living writers."

Irvine Welsh, the Scottish author, added: "Very, very sad to hear this. Amazing writer and excellent guy."

The author Ian Rankin said the news of Banks's terminal cancer was "just awful" and it was "typical of Iain to propose marriage to his partner Adele with the words 'Will you do me the honour of becoming my widow?'"

Banks said he had cancelled all future public engagements.

In his statement, he revealed he initially developed a sore back in late January but thought it was because he was "crouched over a keyboard all day".

The author, who is the son of an ice skater and a naval officer, said his GP spotted he had jaundice and tests revealed the "grisly truth" at the start of last month.

A website has been created for friends and fans to leave messages for Banks, http://friends.banksophilia.com/, which last night was filling up with hundreds of messages.

Banks said he was considering undergoing chemotherapy to "extend the amount of time available".

He also thanked the medical professionals who had helped him, saying the standard of care had been "deeply impressive".