2 Samuel 17:23
21 After the men had left, Ahimaaz and Jonathan climbed out of the well. Then they left and informed King David. They advised David, “Get up and cross the stream quickly, for Ahithophel has devised a plan to catch you.” 22 So David and all the people who were with him got up and crossed the Jordan River. By dawn there was not one person left who had not crossed the Jordan. 23 When Ahithophel realized that his advice had not been followed, he saddled his donkey and returned to his house in his hometown. After setting his household in order, he hanged himself. So he died and was buried in the grave of his father.
Matthew 27:5
2 They tied him up, led him away, and handed him over to Pilate the governor. 3 Now when Judas, who had betrayed him, saw that Jesus had been condemned, he regretted what he had done and returned the 30 silver coins to the chief priests and the elders, 4 saying, “I have sinned by betraying innocent blood!” But they said, “What is that to us? You take care of it yourself!” 5 So Judas threw the silver coins into the temple and left. Then he went out and hanged himself. 6 The chief priests took the silver and said, “It is not lawful to put this into the temple treasury, since it is blood money.” 7 After consulting together they bought the Potter’s Field with it, as a burial place for foreigners.
Notes and References
"... The parallels between Jesus and D avid are given greater depth in relation to those between Judas and Ahithophel. I have made the case, as did Origen (Sel. Ps. 3.1.29, 36 [PG 12:1120c]), that the one “w ho rose against D avid w as Ahithophel” just as the one w ho “rose against the Savior was Judas the traitor.” Specifically, Judas implemented Ahithophets cunning plan for betraying D avid in betraying D avid’s son Jesus. But, for Matthew, Judas could not perform Ahithophets plan without also performing his ow n demise. The parallels between the two characters end with dark finality ... There is much to commend the connection: the verbal form is identical in both stories, appears only in these two instances in the Greek Bible, and Ahithophel and Judas are the only characters in the entirety o f the Bible to hang themselves. Thus, Matthew’s unique account o f Judas’s suicide ties together all of the strands of the Ahithophel typology: Judas's life ends where Ahithophel's did ..."
Johnson, Nathan C. The Passion According to David (pp. 247-272) The Catholic Bible Quarterly, 2018