As articulated by St. Ambrose of Milan in his funerary oration De obitu Valentiniani consolationis* (392 AD) regarding Emperor Valentinian II, a catechumen who died suddenly without water baptism.
The passage from paragraphs 51–53 is preserved verbatim in patristic editions and dogmatic compilations:
"...Sed audio vos dolere, quod non acceperit sacramentum baptismatis. Dicite mihi, quid aliud in nobis est, nisi voluntas, nisi petitio? Atqui etiam dudum hoc voti habuit, ut, cuм in Italiam venisset, initiaretur, et proxime baptizari se a me velle significavit, et ideo prae ceteris causis me accersendum putavit. Non habet ergo gratiam quam desideravit? Non habet quam poposcit? Certe, quia poposcit, accepit. Et unde illud est: "Iustus quacuмque morte preventus fuerit, anima eius in requie erit"... quod si suo abluuntur [martyres] sanguine, et hunc sua pietas abluit et voluntas.1
"But I hear that you grieve since he did not receive the sacrament of Baptism. Tell me, what else is in your power but the desire, the petition? But even for a long time he [Valentinian] had this desire, that when he came into Italy, he should be initiated, and recently he made known that he wanted to be baptized by me, and so he thought I should be summoned for this reason, before other reasons. Surely because he asked, he received, and hence there is the Scripture: 'The just man, whatsoever death he may be overtaken, his soul shall be at rest'... If [martyrs] are washed in their own blood, his devotedness and intention washed him."1
This text equates Valentinian's explicit desire and petition for baptism, expressed to Saint Ambrose himself, with salvific efficacy, akin to baptism of blood for martyrs, since death (not contempt) intervened.1
The Magisterium unequivocally endorses Saint Ambrose's teaching as authoritative for catechumens dying ante sacramentum. A Roman response (cited in Enchiridion Symbolorum, Dz 388/741, pre-Vatican I compilation) applies it directly to an unbaptized priest:
"We assert without hesitation (on the authority of the holy Fathers Augustine and Ambrose) that the priest whom you indicated (in your letter) had died without the water of baptism, because he persevered in the faith of holy mother the Church and in the confession of the name of Christ, was freed from original sin and attained the joy of the heavenly fatherland. Read (brother) in the eighth book of Augustine's "City of God" where among other things it is written, "*Baptism is ministered invisibly to one whom not contempt of religion but death excludes." Read again the book also of the blessed Ambrose concerning the death of Valentinian * where he says the same thing**.1"