2 Samuel 16:13
And as David and his men went by the way, Shimei went along on the hill’s side over against him, and cursed as he went, and threw stones at him, and cast dust. And as David and his men went by the way, Shimei went along on the hill’s side over against him, and cursed as he went, and threw stones at him, and cast dust.
Shimei kept pace with David and his men along the hillside opposite them as they went on the way out of Jerusalem in flight during Absalom's rebellion, cursing as he went and throwing stones at David and casting dust. The reviling fell on David when he was humbled and in distress. David's followers wanted to put Shimei to death for the abuse, but David told them to let him curse. He accepted the cursing as chastisement that God had permitted to come upon him because of his own sin. He hoped that by bearing it humbly God might lessen his affliction and turn Shimei's curse into a blessing.
After Absalom's death, when David was returning, Shimei met him and confessed his rebellion, and David spared and forgave him even though others pressed for his execution.