In autumn 1913, the directors of Vienna's Carltheater commissioned Puccini to compose a Viennese operetta. After confirming that it could take the form of a comic opera with no spoken dialogue in the style of Der Rosenkavalier, "only more entertaining and more organic," he agreed. The work proceeded for two years, sometimes intensely, sometimes with great difficulty, and in spring 1916 the opera was finished. The originally intended Viennese première was impeded by the outbreak of World War I and the entrance of Italy in the Alliance against Austria-Hungary, hence the Opéra de Monte-Carlo was chosen as the location to present it, with Gilda dalla Rizza and Tito Schipa in the leading roles. A feature of the music is Puccini's use of modern dance rhythms, such as the tango, to denote the various characters.
In Italy, Puccini offered the work to his editor Tito Ricordi, who declined to buy it, dismissing it as "Bad Lehár"; thus Ricordi's rival, Lorenzo Sonzogno, obtained the right to give the first performance outside Austria-Hungary and moved the premiere to Monégasque neutral territory. At the premiere in Monte Carlo in 1917 the initial reception by the public and press was warm. However, despite the artistic value of the score, La rondine has been one of Puccini's less successful works; "In box office terms, it was the poor cousin to the other great hits." There is no established final version of it, Puccini being dissatisfied, as often, with the result of his work; he revised it many times to the point of making three versions (1917, 1920, 1921), with two completely different endings, but died before clearly deciding on a final version.