2 Samuel 16:5-14 NIV
As King David approached Bahurim, a man from the same clan as Saul’s family came out from there. His name was Shimei son of Gera, and he cursed as he came out. He pelted David and all the king’s officials with stones, though all the troops and the special guard were on David’s right and left. As he cursed, Shimei said, “Get out, get out, you murderer, you scoundrel! The LORD has repaid you for all the blood you shed in the household of Saul, in whose place you have reigned. The LORD has given the kingdom into the hands of your son Absalom. You have come to ruin because you are a murderer!”
Then Abishai son of Zeruiah said to the king, “Why should this dead dog curse my lord the king? Let me go over and cut off his head.”
But the king said, “What does this have to do with you, you sons of Zeruiah? If he is cursing because the LORD said to him, ‘Curse David,’ who can ask, ‘Why do you do this?’ ”
David then said to Abishai and all his officials, “My son, my own flesh and blood, is trying to kill me. How much more, then, this Benjamite! Leave him alone; let him curse, for the LORD has told him to. It may be that the LORD will look upon my misery and restore to me his covenant blessing instead of his curse today.”
So David and his men continued along the road while Shimei was going along the hillside opposite him, cursing as he went and throwing stones at him and showering him with dirt. The king and all the people with him arrived at their destination exhausted. And there he refreshed himself.
NIV: New International Version