Rejoice when you are persecuted, Jesus tells His disciples, “for in the same way they persecuted (dioko) the prophets who were before you” (Matthew 5:10-12).
Which prophets were those?
The only prophet to speak directly of being persecuted is Jeremiah, who prays that those who persecute (LXX dioko) him (15:15; 17:18).
One difficulty here is linguistic: Both the Greek dioko and the Hebrew radaph generally mean “pursue, chase, put to flight.” Thus, for instance, the Egyptians “persecute/pursue” Israel as they leave Egypt, and Saul radaphs David all around the wilderness. But good things can be “persecuted” too - righteousness, for instance (Isaiah 51:1). And often Yahweh is the “persecutor” as He pursues enemies with sword and bow drawn.
If we take these passages into consideration, David himself is the prophet most persecuted in the Old Testament. He talks incessantly in the Psalms about being pursued and hounded by enemies (Psalm 7:5; 31:15; 34:14; 35:3; 119:157, 161; 142:6; 143:3).
That fits: Jesus comes proclaiming the kingdom, and tells His disciples to expect to be pursued. But in being pursued, they can rejoice in being part of the pursued band of the new David.