After being offered the opportunity to write a musical work, Colette wrote the text in eight days. Several composers were proposed to Colette to write the music, but she was only enthused with the prospect of Ravel.
During World War I, the Opéra de Paris director Jacques Rouché asked Colette to provide the text for a fairy ballet. Colette originally wrote the story under the title Divertissements pour ma fille. After Colette chose Ravel to set the text to music, a copy was sent to him in 1916 while he was still serving in the war; however, the mailed script was lost. In 1917, Ravel finally received a copy and agreed to complete the score, humorously replying to Colette, "I would like to compose this, but I have no daughter."
Ravel began composing the work in the spring of 1920, but then stopped due to physical exhaustion and poor health. He was finally compelled to complete the work by Raoul Gunsbourg, director of the Monte Carlo Opera, who insisted Ravel write a sequel to L'Heure espagnole. This was completed in 1924. Colette, who had believed that the work would never be complete, expressed her extreme pleasure, believing that her modest writing had been raised beyond its initial scope. Now officially under the title of L'enfant et les sortilèges, the first performance took place March 21, 1925 in Monte Carlo as conducted by Victor de Sabata with ballet sequences choreographed by George Balanchine.
Marie-Thérèse Gauley sang the part of the child at both the premiere in Monte-Carlo and the first performance at the Opéra-Comique on 1 February 1926. The original cast also included Henri Fabert as Vieillard Arithmétique, Warnerey as the clock and cat, while at the Opéra-Comique, conducted by Albert Wolff and with choreography by Louise Virard, the cast included Germaine Féraldy, Mathilde Calvet, Madeleine Sibille, Roger Bourdin, René Hérent and Louis Guenot.
The opera was then seen in Prague (17 February 1927), Leipzig (6 May 1927) and Vienna (14 March 1929). The US premiere was given on 19 September 1930 by the San Francisco Opera. The Canadian premiere of the work was a film version made by CBC Television in 1950 with conductor Wilfrid Pelletier. It was not until 3 December 1958 that the opera was given its UK premiere in the Town Hall in Oxford.
The opera calls for a large orchestra, a mixed chorus of adults, a chorus of children and eight soloists, most of whom individually play a number of characters. The scale of the cast and fantastic setting make the opera often difficult to stage, which helps to explain why the work is not performed often. Ravel uses various subtle leitmotifs throughout the work, and there is considerable virtuosity in the instrumental writing. Yet the orchestra plays mostly secondary role to the sung melodies, Ravel explaining that he was following the style of Gershwin and American operettas of the time. Ravel contrasted the work to his previous opera, L'heure espagnole:
More than ever, I am for melody. Yes, melody, bel canto, vocalises, vocal virtuosity – this is for me a point of departure. If, in L'heure espagnole the theatrical action itself demanded that the music be only the commentary on each word and gesture, here, on the contrary, this lyric fantasy calls for melody, nothing but melody.... The score of L'enfant et les sortilèges is a very smooth blending of all styles from all epochs, from Bach up to ... Ravel.
The opera was initially well received in Monte Carlo, but in a Paris production the following year it was less successful. André Messager criticized the purposely imitative nature of the music, but Francis Poulenc and Les six were impressed. His cat duet Duo miaulé is often seen as a parody of Wagner which was quite controversial, although Arthur Honegger praised this piece in particular. The use of pentatonic music and parallel fourths in the depiction of the Chinese tea cup is an example of use of "orientalism" in orchestral music.