Srimad Bhagavatam Canto 07, Chapter 15, Text 76

SB 7.15.76

sa va ayam brahma mahad-vimrgya-
 kaivalya-nirvana-sukhanubhutih
priyah suhrd vah khalu matuleya
 atmarhaniyo vidhi-krd gurus ca
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
How wonderful it is that the Supreme Personality of Godhead, the Parabrahman, Krsna, who is sought by great, great sages for the sake of liberation and transcendental bliss, is acting as your best well-wisher, your friend, your cousin, your heart and soul, your worshipable director, and your spiritual master.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
Krsna can become the director and spiritual master of anyone who is serious about getting the mercy of Krsna. The Lord sends the spiritual master to train a devotee, and when the devotee is advanced, the Lord acts as the spiritual master within his heart.
 
tesam satata-yuktanam
 bhajatam priti-purvakam
dadami buddhi-yogam tam
 yena mam upayanti te
 
“To those who are constantly devoted and worship Me with love, I give the understanding by which they can come to Me.” Krsna does not become the direct spiritual master unless one is fully trained by His representative spiritual master. Therefore, as we have already discussed, the Lord’s representative spiritual master should not be considered an ordinary human being. The representative spiritual master never gives any false knowledge to his disciple, but only perfect knowledge. Thus he is the representative of Krsna. Krsna helps as the guru, or spiritual master, from within and from without. From without He helps the devotee as His representative, and from within He talks personally with the pure devotee and gives him instructions by which he may return home, back to Godhead.
Srimad Bhagavatam Canto 07, Chapter 15, Text 75
Srimad Bhagavatam Canto 07, Chapter 15, Text 77