From Summa Theologiae, IIa-IIae, question 23, article 1:
Objection 1. It would seem that charity is not friendship. For nothing is so appropriate to friendship as to dwell with one’s friend, according to the Philosopher (Ethic. viii, 5). Now charity is of man towards God and the angels, “whose dwelling [Douay: ‘conversation’] is not with men” (Daniel 2:11). Therefore charity is not friendship.
Objection 2. Further, there is no friendship without return of love (Ethic. viii, 2). But charity extends even to one’s enemies, according to Matthew 5:44: “Love your enemies.” Therefore charity is not friendship.
Objection 3. Further, according to the Philosopher (Ethic. viii, 3) there are three kinds of friendship, directed respectively towards the delightful, the useful, or the virtuous. Now charity is not the friendship for the useful or delightful; for Jerome says in his letter to Paulinus which is to be found at the beginning of the Bible: “True friendship cemented by Christ, is where men are drawn together, not by household interests, not by mere bodily presence, not by crafty and cajoling flattery, but by the fear of God, and the study of the Divine Scriptures.” No more is it friendship for the virtuous, since by charity we love even sinners, whereas friendship based on the virtuous is only for virtuous men (Ethic. viii). Therefore charity is not friendship.
On the contrary, It is written (John 15:15): “I will not now call you servants . . . but My friends.” Now this was said to them by reason of nothing else than charity. Therefore charity is friendship.
I answer that, According to the Philosopher (Ethic. viii, 2,3) not every love has the character of friendship, but that love which is together with benevolence, when, to wit, we love someone so as to wish good to him. If, however, we do not wish good to what we love, but wish its good for ourselves, (thus we are said to love wine, or a horse, or the like), it is love not of friendship, but of a kind of concupiscence. For it would be absurd to speak of having friendship for wine or for a horse.
Yet neither does well-wishing suffice for friendship, for a certain mutual love is requisite, since friendship is between friend and friend: and this well-wishing is founded on some kind of communication.
Accordingly, since there is a communication between man and God, inasmuch as He communicates His happiness to us, some kind of friendship must needs be based on this same communication, of which it is written (1 Corinthians 1:9): “God is faithful: by Whom you are called unto the fellowship of His Son.” The love which is based on this communication, is charity: wherefore it is evident that charity is the friendship of man for God.
Reply to Objection 1. Man’s life is twofold. There is his outward life in respect of his sensitive and corporeal nature: and with regard to this life there is no communication or fellowship between us and God or the angels. The other is man’s spiritual life in respect of his mind, and with regard to this life there is fellowship between us and both God and the angels, imperfectly indeed in this present state of life, wherefore it is written (Philippians 3:20): “Our conversation is in heaven.” But this “conversation” will be perfected in heaven, when “His servants shall serve Him, and they shall see His face” (Apocalypse 22:3-4). Therefore charity is imperfect here, but will be perfected in heaven.
Reply to Objection 2. Friendship extends to a person in two ways: first in respect of himself, and in this way friendship never extends but to one’s friends: secondly, it extends to someone in respect of another, as, when a man has friendship for a certain person, for his sake he loves all belonging to him, be they children, servants, or connected with him in any way. Ondeed so much do we love our friends, that for their sake we love all who belong to them, even if they hurt or hate us; so that, in this way, the friendship of charity extends even to our enemies, whom we love out of charity in relation to God, to Whom the friendship of charity is chiefly directed.
Reply to Objection 3. The friendship that is based on the virtuous is directed to none but a virtuous man as the principal person, but for his sake we love those who belong to him, even though they be not virtuous: in this way charity, which above all is friendship based on the virtuous, extends to sinners, whom, out of charity, we love for God’s sake.