Pope Paul VI
Sacerdotalis Caelibatus §88
Sacerdotalis Caelibatus: On the Celibacy of the Priest
88 There are some whose priesthood cannot be saved, but whose serious dispositions nevertheless give promise of their being able to live as good Christian lay people. To these the Holy See, having studied all the circumstances with their bishops or with their religious superiors, sometimes grants a dispensation, thus letting love conquer sorrow. In order, however, that her unhappy but always dear son may have a salutary sign of her maternal grief and a keener remembrance of the universal need of God's mercy, in these cases she imposes some works of piety and reparation .
Source: Sacerdotalis Caelibatus (Vatican.va)