The score had spent most of three centuries in a wooden chest in the vestry of a Lutheran church in Pirna, 20 kilometers up the Elbe from here, filed under hymns. When a graduate student opened it in 2023 looking for cantatas, she found instead 340 pages of a full-length opera in a confident, rapid hand, its title page reading “L’Erminia, dramma per musica, Dresden 1719.”

On Friday night that opera was performed for what is believed to be the first time since the year it was written. The composer, Johann Caspar Ritterlein, was a court musician in Dresden who died in 1741 and whose name survived only in payroll records and a single scathing letter from a rival. On the evidence of the Semperoper’s production, the rival was jealous.

“It is not a curiosity. It is a very good opera,” said Felicitas Ahrend, who conducted the Dresden Festival Orchestra on period instruments. “There are three arias in the second act that any singer alive would kill for. We simply did not know they existed.”

The plot, drawn from Tasso’s “Jerusalem Delivered,” follows the Saracen princess Erminia, who disguises herself in armor to reach the Christian knight she loves. It was written for the wedding celebrations of the Saxon crown prince in 1719, one of the most lavish festivals of the German Baroque, and then apparently never revived. Ulrich Neuhoff, the musicologist at the Dresden University of Music who prepared the performing edition, believes it was shelved when an Italian composer arrived at court the following year and took over the opera house. “Fashion changed, Ritterlein did not, and the score went to his brother-in-law, who happened to be the pastor in Pirna,” he said. “That is the whole mystery. It is quite banal.”

The production, directed by Carla Mendonça, is spare: a tilted mirror floor, period costumes in black and bone, and a company of nine singers. The French countertenor Bastien Morel, in the role of the knight Tancredi, drew the longest ovation of the evening for a lament built on a descending bass that repeats 24 times. The Polish soprano Zofia Kaminska sang the title role.

All six performances sold out within four days of going on sale, and a recording is planned for next spring. The score itself has been acquired by the Saxon State Library, which has digitized it and made it freely available.

Dr. Neuhoff said he is now searching other parish archives along the Elbe. “Every church in Saxony had a chest,” he said. “We have opened about a third of them.”

In the lobby after the performance, a retired schoolteacher from Pirna named Gudrun Seidel said she had sat in the church for 60 years without knowing. “It was under the hymnals,” she said. “Right under us.”