John 18:33-34
“Having entered in, he asked Jesus, and said, Are you the King of the Jews? Jesus answered him, Do you say this thing of yourself, or did others tell it you of Me?”
Wherefore did Christ ask this? Because He desired to expose the evil intentions of the Jews. Pilate had heard this saying from many, and, since the accusers had nothing to say, in order that the enquiry might not be a long one, he desires to bring forward that which was continually reported. But when he said to them, “Judge him according to your law,” wishing to show that His offense was not a Jewish one, they replied, “It is not lawful for us.” “He has not sinned against our law, but the indictment is general.” Pilate then, having perceived this, says, as being (himself) likely to be endangered, “Are you the King of the Jews?” Then Jesus, not from ignorance, but from a desire that the Jews should be accused even by him, asked him, saying, “Did others tell it you?” On this point then declaring himself, Pilate replied,
Source: Homilies on the Gospel of John (New Advent)