The Sages have said:

What is the cause of the mourning (Zechariah 12:10)? It is well according to him who explains that the cause is the slaying of Messiah, the son of Joseph, as it is written, 'And they shall look upon me whom they have pierced; and they shall mourn for him as one mourneth for his only son.'

Babylonian Talmud

Babylonian Talmud, Sukkah 52a

The Sages have said:

The rabbis have taught, the Holy One, blessed by He, will say to Messiah ben David, may he be revealed soon in our days. 'Ask of Me anything and I shall give it to you.' For it is written, Adonai said to me, 'Thou art my son, this day have I begotten thee. Ask of Me and I will give thee the nations for thine inheritance (Psalm 2:7-8).' And when he will see that Messiah ben Joseph will be slain, he will say before Him, 'Master of the World! I ask nothing of you except life.' G~d will say to him, 'Even before you said, "life," your father David prophesied about you, as it is written, 'He asked life of thee, Thou gavest it to him. (Psalm 21:5)'

Babylonian Talmud

[Babylonian Talmud, Sukkah 52a]