2 Samuel 19:18
And there went over a ferry boat to carry over the king’s household, and to do what he thought good. And Shimei the son of Gera fell down before the king, as he was come over Jordan; And there went over a ferry boat to carry over the king’s household, and to do what he thought good. And Shimei the son of Gera fell down before the king, as he was come over Jordan;
The verse takes place as David returns to Jerusalem after Absalom's death, when God has turned the hearts of Israel to David as the heart of one man. Shimei is the man who had cursed David in David's humility and humiliation. Acting from fear for his life, Shimei is among the first of the rebels and of the rebellious party to meet David, falling down before the king to confess his rebellious conduct toward him.
Those who had witnessed Shimei's abusive course urge David not to spare his life because he cursed the Lord's anointed. David rebukes them and not only spares Shimei's life but mercifully forgives him. In doing so David shows he has no revengeful spirit, though he could readily have gratified it by putting the offender to death. This proves David is not the bloody and mischievous man Shimei had represented him to be.