Vatican II, "Lumen gentium"
By an utterly free and mysterious decree of his own wisdom and goodness, the eternal Father created the whole world. His plan was to dignify men with a participation in his own divine life. When in Adam men had fallen, he did not abandon them, but ceaselessly offered them help to salvation, in anticipation of Christ the Redeemer, ‘who is the image of the invisible God, the firstborn of every creature’. All the elect, before time began, the Father ‘foreknew and predestined to become conformed to the image of his Son, that he should be the firstborn among many brethren’.
All those who would believe in Christ he planned to assemble in the holy Church, which was already foreshadowed from the beginning of the world. In a remarkable way the Church was prepared for throughout the history of the people of Israel and by means of the Old Covenant. Established in the present era of time, she was made manifest by the outpouring of the Spirit. At the end of time she will achieve her glorious fulfilment. Then, as may be read in the holy Fathers, all just men from the time of Adam, ‘from Abel, the just one, to the last of the elect’, will be gathered together with the Father in the universal Church.
Finally, those who have not yet received the gospel are related in various ways to the People of God.
In the first place there is that people to whom the covenants and promises were made and from whom Christ was born according to the flesh. On account of their fathers, this people remains most dear to God, for God does not repent of the gifts he makes nor of the calls he issues.
But the plan of salvation also includes those who acknowledge the creator. In the first place among these there are the Moslems; they profess to hold the faith of Abraham, and along with us adore the one and merciful God, who will judge mankind on the last day.
Nor is God himself far distant from those who in shadows and images seek the unknown God, for it is he who gives to all men life and breath and every other gift, and who as Saviour wills that all men be saved.
Those also can attain to everlasting salvation who through no fault of their own do not know the gospel of Christ or his Church, yet sincerely seek God and, moved by grace, strive by their deeds to do his will as it is known to them through the dictates of conscience. Nor does divine Providence deny the help necessary for salvation to those who, without blame on their part, have not yet arrived at an explicit knowledge of God but who strive, aided by his grace, to live a good life.
Whatever goodness or truth is found amongst them, is looked upon by the Church as a preparation for the gospel, and as given by him who enlightens all men that they may finally have life.