During David's reign there was a famine for three successive years, so David inquired of the Lord. The Lord answered, "It is because of the blood shed by Saul and his family when he killed the Gibeonites."
References for 2 Samuel 21:1
The Gibeonites were not Israelites but rather a remnant of the Amorites. The Israelites had taken an oath concerning them, but Saul had tried to kill them in his zeal for the Israelites and Judah. So David summoned the Gibeonites and spoke to them.
References for 2 Samuel 21:2
He asked the Gibeonites, "What should I do for you? How can I wipe out this guilt so that you will bring a blessing on the Lord's inheritance?"
References for 2 Samuel 21:3
The Gibeonites said to him, "We are not asking for money from Saul or his family, and we cannot put anyone to death in Israel." "Whatever you say, I will do for you," he said.
References for 2 Samuel 21:4
They replied to the king, "As for the man who annihilated us and plotted to exterminate us so we would not exist within the whole territory of Israel,
let seven of his male descendants be handed over to us so we may hang them in the presence of the Lord at Gibeah of Saul, the Lord's chosen." The king answered, "I will hand them over."
References for 2 Samuel 21:6
David spared Mephibosheth, the son of Saul's son Jonathan, because of the oath of the Lord that was between David and Jonathan, Saul's son.
References for 2 Samuel 21:7
But the king took Armoni and Mephibosheth, who were the two sons whom Rizpah daughter of Aiah had borne to Saul, and the five sons whom Merabdaughter of Saul had borne to Adriel son of Barzillai the Meholathite
References for 2 Samuel 21:8
and handed them over to the Gibeonites. They hanged them on the hill in the presence of the Lord; the seven of them died together. They were executed in the first days of the harvest at the beginning of the barley harvest.
References for 2 Samuel 21:9
Rizpah, Aiah's daughter, took sackcloth and spread it out for herself on the rock from the beginning of the harvest until the rain poured down from heaven on the bodies. She kept the birds of the sky from them by day and the wild animals by night.
References for 2 Samuel 21:10
When it was reported to David what Saul's concubine Rizpah, daughter of Aiah, had done,
he went and got the bones of Saul and his son Jonathan from the leaders of Jabesh-gilead. They had stolen them from the public square of Beth-shan where the Philistines had hung them the day the Philistines killed Saul at Gilboa.
References for 2 Samuel 21:12
David had the bones brought from there. They also gathered up the bones of Saul's family who had been hung.
References for 2 Samuel 21:13
They [also] buried the bones of Saul and his son Jonathan at Zela in the land of Benjamin in the tomb of Saul's father Kish. They did everything the king commanded. After this, God answered prayer for the land.
References for 2 Samuel 21:14