In the Gospel of John, Jesus states "I am the good shepherd" in two verses, John 10:11 and 10:14.
I am the good shepherd. The good shepherd lays down his life for the sheep. He who is a hired hand, and not a shepherd, who doesn't own the sheep, sees the wolf coming, leaves the sheep, and flees. The wolf snatches the sheep, and scatters them. The hired hand flees because he is a hired hand, and doesn't care for the sheep. I am the good shepherd. I know my own, and I'm known by my own; even as the Father knows me, and I know the Father. I lay down my life for the sheep. I have other sheep, which are not of this fold. I must bring them also, and they will hear my voice. They will become one flock with one shepherd. Therefore the Father loves me, because I lay down my life, that I may take it again. No one takes it away from me, but I lay it down by myself. I have power to lay it down, and I have power to take it again. I received this commandment from my Father.
— John 10:11–18