A central figure in the group that included Paul and Jane Bowles, he lived in a mud hut in the Marrakesh oasis with a Dutch baroness

John Hopkins, who has died aged 83, was an American novelist and diarist, best known for The Tangier Diaries, a literary history of Tangier from 1962 to 1979. Encouraged in his writing by Paul Bowles, he was a central figure in the group that included Jane Bowles, Tennessee Williams, William Burroughs and Brion Gysin.

John Livingston Hopkins was born on August 5 1938 in Morristown, New Jersey; his well-heeled parents brought up John, his sister and two half-siblings, in Far Hills, an affluent enclave known for its discreet mansions and fox-hunting enthusiasts. Hopkins was educated privately at the Peck School and was a boarder at Hotchkiss.

At Princeton, where he studied Political Science, he was a member of the posh “eating club” the Ivy, and played varsity ice hockey, including a match against Yale at Madison Square Garden.

Graduating in 1960, and following a summer course in Spain, he and a Princeton friend, Joe McPhillips, went to South America with the idea of buying or starting up a coffee plantation in the Peruvian jungle. In Lima, Hopkins began keeping a diary. They crossed the Andes by jungle bus and visited coffee plantations, and slid down the Amazon on a balsa raft, adventures recounted by Hopkins in his first novel, The Attempt (1967); but they decided that growing coffee was not a viable business, and two months later they boarded an Italian liner bound for Naples.

In Italy they found employment reading to the blind English writer Percy Lubbock – a friend of Edith Wharton and Henry James – who lived in a villa on the Gulf of La Spezia. Lubbock challenged Hopkins to take a notebook to an offshore island, “stay there for 24 hours and write what comes into your head.” Hopkins reckoned he became a writer that day.

In Munich Hopkins and McPhillips bought a white BMW motorcycle they christened “The White Nile,” and rode it for the next five months across North Africa in high summer, en route to Kenya, where they had an invitation from an Ivy Club member.

It was a disaster: their host locked himself in the laundry with cases of beer and never appeared, saying he feared an impending attack by the Mau Mau, which turned out to be a migration of ferocious baboons who killed 40 dogs on the ranch; and both caught pneumonia. Hopkins later wrote about this in The White Nile Diaries (2012).

They flew to France, which they found cold and expensive. Hopkins taught at a school near Verdun, and McPhillips in Paris. However, they met a Yale graduate brought up in Tangier, who suggested they try Morocco, and got them jobs at the American School in Tangier, where they planned to stay for a year. Hopkins stayed for nearly 20 years, McPhillips for the rest of his life.

Hopkins lived for several years without telephone or electricity in a mud hut called Le Petit Mansion in the Marrakesh oasis with a Dutch baroness who travelled with seven suitcases and a parrot.

In 1964, Paul Bowles encouraged Hopkins to find the grave in Algiers of Isabelle Eberhardt, a feisty American journalist. This entailed the excursions over the Atlas Mountains and into the Sahara desert detailed in his 2019 novel Land without Echoes, the last of his 10 published books.

In Tangier in 1977 he met and married Ellen Ann Ragsdale, an artist from Little Rock, Arkansas. In 1979 they moved to Chelsea in London, and in 1982 into an Oxfordshire National Trust property reserved for an American writer or artist.

John Hopkins is survived by his wife and three sons. John Hopkins, born August 5 1938, died March 25 2021