Mefistofele is one of many pieces of classical music to be based on the Faust legend. Like many other composers, Boito used Goethe's version as the basis for his work. Boito was a great admirer of Richard Wagner, and like him he wrote his own libretto.
The premiere of the work in 1868 was a complete flop. The audience had heard beforehand that Boito planned to completely change the face of Italian opera, and reacted with hostility. As well as disliking specific scenes, such as the scene in the emperor's court, it is likely that the sheer length of the work was a problem for much of the audience. It has also been suggested that the singers at the premiere was sub-par. After just two performances, the opera was withdrawn.
Boito set to work revising the opera, and a largely rewritten version was premiered in Bologna in 1875, sung by what is generally regarded to be a very fine cast. Boito had greatly reduced the length of the work, and made many of the remaining scenes on a smaller scale. He had also rewritten the role of Faust, a tenor in the original version, for a baritone. The performance was a success. This change in reaction is thought to be due to a combination of Boito's work being in a more traditional Italian style, and also the Italian audience being more familiar with, and more willing to accept, modern developments in opera associated with Wagner.
Boito made more minor revisions in 1876, and this definitive version was first performed in Venice on May 13, 1876. The first British and American performances, in London and New York City respectively, both came in 1880. It is nowadays probably the second most popular work based on Goethe's work after Gounod's Faust.