5 “For the Father Himself,” He says, “loves you, because you have loved me.” Is it the case, then, that He loves, because we love; or rather, that we love, because He loves? Let this same evangelist give us the answer out of his own epistle: “We love Him,” he says, “because He first loved us.” This, then, was the efficient cause of our loving, that we were loved. And certainly to love God is the gift of God. He it was that gave the grace to love Him, who loved while still unloved.
Even when displeasing Him we were loved, that there might be that in us whereby we should become pleasing in His sight. For we could not love the Son unless we loved the Father also. The Father loves us, because we love the Son; seeing it is of the Father and Son we have received [the power] to love both the Father and the Son: for love is shed abroad in our hearts by the Spirit of both, by which Spirit we love both the Father and the Son, and whom we love along with the Father and the Son. God, therefore, it was that wrought this religious love of ours whereby we worship God; and He saw that it is good, and on that account He Himself loved that which He had made. But He would not have wrought in us something He could love, were it not that He loved ourselves before He wrought it.
Source: Tractates on the Gospel of John (New Advent)