Maugham returned to England from his ambulance unit duties to promote Of Human Bondage. With that completed, he was eager to assist the war effort again. As he was unable to return to his ambulance unit, Syrie arranged for him to be introduced to a high-ranking intelligence officer known as "R;" he was recruited by John Wallinger. In September 1915, Maugham began work in Switzerland, as one of the network of British agents who operated against the Berlin Committee, whose members included Virendranath Chattopadhyay, an Indian revolutionary trying to resist colonial Britain's rule of India. Maugham lived in Switzerland as a writer.
In 1916, Maugham travelled to the Pacific to research his novel The Moon and Sixpence, based on the life of Paul Gauguin. This was the first of his journeys through the late-Imperial world of the 1920s and 1930s which inspired his novels. He became known as a writer who portrayed the last days of colonialism in India, Southeast Asia, China and the Pacific, although the books on which this reputation rests represent only a fraction of his output. On this and all subsequent journeys, he was accompanied by Haxton, whom he regarded as indispensable to his success as a writer. Maugham was painfully shy, and Haxton the extrovert gathered human material which the author converted to fiction.
In June 1917, Maugham was asked by Sir William Wiseman, an officer of the British Secret Intelligence Service (later named MI6), to undertake a special mission in Russia. It was part of an attempt to keep the Provisional Government in power and Russia in the war by countering German pacifist propaganda. Two and a half months later, the Bolsheviks took control. Maugham subsequently said that if he had been able to get there six months earlier, he might have succeeded. Quiet and observant, Maugham had a good temperament for intelligence work; he believed he had inherited from his lawyer father a gift for cool judgement and the ability to be undeceived by facile appearances.
Maugham used his spying experiences as the basis for Ashenden: Or the British Agent, a collection of short stories about a gentlemanly, sophisticated, aloof spy. This character is considered to have influenced Ian Fleming's later series of James Bond novels. In 1922, Maugham dedicated his book On A Chinese Screen to Syrie. This was a collection of 58 ultra-short story sketches, which he had written during his 1920 travels through China and Hong Kong, intending to expand the sketches later as a book.
Dramatised from a story first published in his collection The Casuarina Tree (1924), Maugham's play The Letter, starring Gladys Cooper, had its premiere in London in 1927. Later, he asked that Katharine Cornell play the lead in the 1927 Broadway version. The play was adapted as a film by the same name in 1929, and again in 1940, for which Bette Davis received an Oscar nomination. In 1951, Cornell was a great success playing the lead in his comedy, The Constant Wife.
In 1926, Maugham bought the Villa La Mauresque, on 9 acres (3.6 hectares) at Cap Ferrat on the French Riviera and it was his home for most of the rest of his life. There he hosted one of the great literary and social salons of the 1920s and 30s. He continued to be highly productive, writing plays, short stories, novels, essays and travel books. By 1940, when the collapse of France and its occupation by the German Third Reich forced Maugham to leave the French Riviera, he was a refugee – but one of the wealthiest and most famous writers in the English-speaking world.
Maugham's novel, An Appointment in Samarra (1933), is based on an ancient Babylonian myth: Death is both the narrator and a central character. The American writer John O'Hara credited Maugham's novel as a creative inspiration for his own novel Appointment in Samarra.