Completed while Gentileschi was living in Florence with her husband, a lesser known painter, the three-and-a-half by three foot piece was commissioned by Fernando Enríquez Afán de Ribera, the third Duke of Alcalá, and Viceroy of Naples, during his time as the Spanish ambassador in Rome.
Though the painting was originally located in his home, Casa de Pilatos in Seville, Gentileschi’s work disappeared from public records after being passed down to Ribera's heirs. However, memory of the piece didn’t disappear, and multiple duplicates had been rendered during its absence. One of the well-known copies can be found in the Cathedral of Seville, and another is held by the Museo Soumaya in Mexico City.
Penitent Mary Magdalene, also known as Mary Magdalene as Melancholy, was finished in the years following one of her best-known paintings, Judith and Her Maidservant with the Head of Holofernes (1623–25), now part of the the Detroit Institute of Arts’ permanent collection. In fact, it was subtle allusions to this earlier piece that helped art historian Jesse Locker and others verify it as an original in 2021.