Janáček had seen the play early in its run in Prague on 10 December 1922, and immediately saw its potential as an opera. He entered into a correspondence with Čapek, who was accommodating towards the idea, although legal problems in securing the rights to the play delayed work. When these problems were cleared on 10 September 1923, Janáček began work on the opera. By December 1924, he had completed the first draft of the work. He spent another year refining the score, before completing it on 3 December 1925.
Musically, much of the piece has little in the way of thematic development, instead presenting the listener with a mass of different motifs and ideas. Janáček's writings indicate that this was a deliberate ploy to give musical embodiment to the disruptive, unsettling main character Emilia Marty/Elina Makropulos. Only at the end of the final act, when Makropulos' vulnerability is revealed, does the music tap into and develop the rich lyrical vein that has driven it throughout.
Janáček was making adjustments to the score almost right up to the premiere in Brno. Two years after its premiere, the opera was given in Prague, and also in Germany in 1929, but it did not become really popular until a production by the Sadler's Wells company in London in 1964, conducted by Charles Mackerras with Marie Collier as Emilia Marty. While performed with some regularity, it has not become part of the core opera repertory in the same way as have Jenůfa, Káťa Kabanová or The Cunning Little Vixen.
In 1966, the San Francisco Opera gave the first US performances (in an English translation), also with Marie Collier in the lead role. The first New York City performance was in December 1967, by the Little Orchestra Society with Naděžda Kniplová as Emilia Marty. The first Metropolitan Opera production of the opera, in an English translation, had its opening night on 5 January 1996, but ended prematurely only a few minutes into Act 1 when tenor Richard Versalle, 63, whilst climbing the 20-foot ladder which was part of the set, fell 10 feet from the ladder, from a heart attack, immediately after singing Vitek's line: "Too bad you can only live so long". His death was reported that same evening. The scheduled second performance on 8 January 1996 was cancelled because of severe winter weather, and the first full performance of the Metropolitan Opera production did not occur until 11 January 1996. The first Metropolitan Opera performances of the work in the original Czech occurred in April 1998.
Tomáš Šimerda directed a 2001 version of the opera for Czech television, with Gabriela Beňačková as Emilia Marty, and a cast that included Roman Sadnik, Jan Hladík, Zdeněk Šmukař, Monika Brychtová, and Pavel Kamas, with the Brno National Theatre Chorus and Orchestra and conductor Oliver von Dohnányi. The opera has been performed twice at The Proms, in August 1995 (the Glyndebourne production presented in concert at the Royal Albert Hall) and in August 2016 (with the BBC Symphony Orchestra, in a semi-staged concert version).
Kolenatý's law office, Prague, 1922
Vitek, Kolenatý's clerk, notes that the probate case of Gregor v. Prus has been going on for almost a century. Kolenatý represents the middle-class Gregors against the wealthy and aristocratic Prus family. Albert Gregor comes in to ask about the case. Kolenatý is at the Supreme Court, but has not returned because he is expecting the final resolution. Vitek's daughter Kristina, enters. She is a young singer, and praises Emilia Marty, a famous singer she has seen rehearsing and admits that she will never be the artist Emilia Marty is.
Kolenatý returns, accompanied by Emilia Marty, who reviews the case with her. Baron Joseph Ferdinand Prus died in 1827, leaving no will or legitimate children. His cousin claimed the estate, but so did Albert's ancestor, Ferdinand Gregor, who asserted that the Baron had promised the estate to him. Each party presented different evidence to support their case, but neither could proffer an actual will. Here Emilia interrupts. Speaking with unusual familiarity of these long-ago events, she states that Ferdinand Gregor was the out-of-wedlock son of Baron Joseph (who was a very centered and diligent man, contradicting Dr. Kolenatý's description) and opera singer Ellian MacGregor. Kolenatý says that the case seems to be on the side of the Prus family, because there is no will. Emilia asks what would be required for Albert Gregor to win, and Kolenatý answers that the missing will is such an item. Emilia says that there is in fact a will, and describes an old cupboard in the Prus mansion where important papers were kept, where that document may be found.
Kolenatý thinks Emilia is inventing stories, but Albert insists that Kolenatý investigate at once, and even threatens to take the case to a rival lawyer. Kolenatý leaves, and Albert tells Emilia that if he does not get the estate, he will be penniless and shoot himself. He is already infatuated with Emilia, and makes advances to her. But Emilia, bored and indifferent, coldly refuses him. However, she asks his help in retrieving a document that will be found with the will.
Kolenatý returns with Jaroslav Prus. They found the will where Emilia said it would be, and Jaroslav congratulates Albert on his victory – if he can prove that Ferdinand Gregor was the Baron's out-of-wedlock son. Emilia says that she can prove that.
The empty stage of the opera house
A stagehand and a cleaning woman discuss Emilia's extraordinary performance. Jaroslav enters, seeking Emilia, accompanied by his young son Janek, and Kristina. Kristina explains to Janek that she cannot continue her relationship with him.
Emilia enters, but spurns them all, including Janek, who falls under her spell, and Albert, who brings her expensive flowers. The old Count Hauk-Šendorf enters, and thinks he recognizes Emilia as Eugenia Montez, a Romani woman with whom he had an affair in Andalusia half a century before. Emilia tells him Eugenia is not dead, and in Spanish, calls him by a pet name and asks him for a kiss.
All except Jaroslav leave. He demands an explanation of her strange interest in his family, and reveals that the mother of the Baron's child was recorded as Elina Makropulos, who might be the same as Ellian MacGregor, whose love letters he has read. Prus describes her as a passionate woman with flexible morals, to which Emilia takes offense. He continues saying that only a descendant of Ferdinand Makropoulos can claim the estate. Emilia offers to buy a mysterious document found with the will, but Jaroslav refuses and leaves. Albert returns and again pleads his love, but Emilia merely falls asleep, and Albert leaves. Janek returns, and Emilia asks him to get the document for her. Jaroslav overhears this, and orders Janek to leave. He then agrees to provide the document himself if Emilia will spend the night with him.
Emila's hotel room the next morning
Emilia and Jaroslav have spent the night together. Though disappointed by Emilia's coldness, Jaroslav nonetheless gives her the envelope containing the document. News arrives that Janek has committed suicide because of his infatuation with Emilia. Jaroslav grieves, but Emilia is absolutely indifferent. Jaroslav hardly has time to express his anger at her reaction before Count Hauk-Šendorf enters. Hauk-Šendorf says that he has left his wife and wants to elope with Emilia to Spain. Albert, Kolenatý, and Kristina enter, with a doctor who takes Count Hauk-Šendorf away. Kolenatý has noticed that Emilia's handwriting matches that of Ellian MacGregor and suspects her of forgery. She leaves the room to get dressed, and says that after she has had her breakfast, she will clarify everything.
The rest of the party begins to search her papers and belongings. The searchers find many documents and keepsakes, all bearing names with the initials 'E.M.'. Jaroslav says that the handwriting of Elina Makropulos on Ferdinand's birth certificate also matches that of Emilia.
Emilia returns, drunk and with a pistol, but Albert disarms her. Emilia decides to tell the truth. She is Elina Makropulos, born in 1585, daughter of Hieronymus Makropulos, an alchemist in Emperor Rudolf II's Court, who ordered him to prepare a potion that would extend his life. When the potion was ready, the Emperor ordered his alchemist to test it on his daughter first. She fell into a coma, and Hieronymus was sent to prison. After a week, Elina woke up and fled with the formula, which proved successful. She has since lived an itinerant life for three centuries, becoming one of the best singers of all time. To conceal her longevity, she has assumed many identities, including 'Eugenia Montez', 'Ekaterina Myshkin', and 'Ellian McGregor'. She confided her secret to Baron Joseph and gave him the formula, which he attached to his will for his son. However, the document was lost among the Baron's papers after his death.
The potion is finally wearing off. Elina wanted the formula to gain another 300 years of life. As the first signs of old age appear on her face, the others, initially disbelieving her story, come to believe her, and to feel pity for her. Elina has realized that perpetual youth has led her to exhausted apathy and resolves to allow death to come naturally to her, understanding that a sense of transcendence and purpose come from a naturally short span of life. Aging rapidly before the eyes of the astonished onlookers, she offers Kristina the formula so she now can become a great artist herself. However, Kristina burns the parchment in a candle flame. Elina collapses as she recites the first words of the Lord's Prayer in Greek.