The prophet Nathan confronted David about his sin with Bathsheba. David responded in repentance. He wrote Psalm 51 at this time. Here we see David's humility and his true heart for the Lord. Though Nathan told David that his son would die as a result of his sin, David pleaded with the Lord for his son's life. David’s relationship with God was such that he was willing to persist in faith and to hope that God might relent. When God enacted His judgment, David accepted it completely (2 Samuel 12). In this story we also see God's grace and sovereignty. Solomon, David's son who succeeded him and through whom Jesus descended, was born of David and Bathsheba.