La Fenice of Venice commissioned Verdi in 1850 to compose a new opera. He was prominent enough by this time to enjoy some freedom in choosing texts to set to music. He initially asked Francesco Maria Piave (with whom he had already created Ernani, I due Foscari, Macbeth, Il Corsaro and Stiffelio) to examine the play Kean by Alexandre Dumas, père, but soon came to believe that they needed to find a more energetic subject.
That came in the form of Victor Hugo's controversial five-act play Le roi s'amuse. Verdi later explained that "The subject is grand, immense, and there is a character that is one of the greatest creations that the theatre can boast of, in any country and in all history." However, Hugo's depiction of a venal, cynical, womanizing king (Francis I of France) was considered unacceptably scandalous. The play had been banned in France following its premiere nearly twenty years earlier (not to be staged again until 1882); now it was to come before the Austrian Board of Censors (as Austria at that time directly controlled much of Northern Italy.)
From the beginning, both composer and librettist knew this step would not be easy. As Verdi wrote in a letter to Piave: "Use four legs, run through the town and find me an influential person who can obtain the permission for making Le Roi s'amuse." Guglielmo Brenna, secretary of La Fenice, promised the duo that they would not have problems with the censors. He was wrong, and rumours began to spread in early summer that the production would be forbidden. In August, Verdi and Piave retired to Busseto, Verdi's hometown, to prepare a defensive scheme as they continued work on the opera. Despite their best efforts, including frantic correspondence with La Fenice, the Austrian censor De Gorzkowski emphatically denied consent to the production of "La Maledizione" (its working title) in a December 1850 letter, calling the opera "a repugnant [example of] immorality and obscene triviality."
's poster for the world premiere of Rigoletto
Piave set to work revising the libretto, eventually pulling from it another opera, Il Duca di Vendome, in which the sovereign was a duke and both the hunchback and the curse disappeared. Verdi was completely against this proposed solution, preferring to negotiate directly with the censors over each and every point of the work. Brenna, La Fenice's sympathetic secretary, mediated the dispute by showing the Austrians some letters and articles depicting the bad character, but great value, of the artist. By January 1851 the parties had settled on a compromise: the action of the opera would be moved, and some of the characters would be renamed. In the new version, the Duke would preside over Mantua and belong to the Gonzaga family. (The House of Gonzaga had long been extinct by the mid-19th century, and the Dukedom of Mantua no longer existed.) The scene in which he retired to Gilda's bedroom would be deleted, and his visit to the Taverna (inn) would no longer be intentional, but the result of a trick. The hunchbacked jester (originally called Triboulet) was renamed Rigoletto (from the French word rigoler) from a parody of a comedy by Jules-Édouard Alboize de Pujol: Rigoletti, ou Le dernier des fous (Rigoletti, or The last of the fools) of 1835. By 14 January, the opera's definitive title had become Rigoletto.
Verdi finally completed the composition on 5 February 1851, a little more than a month before the premiere. Piave had already arranged for the sets to be designed while Verdi was still working on the final stages of Act 3. The singers were given some of their music to learn on 7 February. However, Verdi kept at least a third of the score at Busseto. He brought it with him when he arrived in Venice for the rehearsals on 19 February, and would continue refining the orchestration throughout the rehearsal period. For the première, La Fenice had cast Felice Varesi as Rigoletto, the young tenor Raffaele Mirate as the Duke, and Teresa Brambilla as Gilda (although Verdi would have preferred Teresa De Giuli Borsi). Due to a high risk of unauthorised copying, Verdi demanded extreme secrecy from all his singers and musicians, particularly Mirate: the "Duke" had the use of his score for only a few evenings before the première, and was made to swear that he would not sing or even whistle the tune of "La donna è mobile" except during rehearsal.