In verse 7 we read that David "spared" Mephibosheth from the Gibeonites, then in verse 8 we read he delivered him (along with 6 others) into the hands of the Gibeonites to be hanged.
2 Samuel 21:7 - 8
NKJV - 7 But the king spared Mephibosheth the son of Jonathan, the son of Saul, because of the LORD's oath that was between them, between David and Jonathan the son of Saul. 8 So the king took Armoni and Mephibosheth, the two sons of Rizpah the daughter of Aiah, whom she bore to Saul, and the five sons of Michal the daughter of Saul, whom she brought up for Adriel the son of Barzillai the Meholathite.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.