2 Samuel 11:2-5

11:2 One evening David got up from his bed and walked around on the roof of his palace. From the roof he saw a woman bathing. Now this woman was very attractive. 11:3 So David sent someone to inquire about the woman. The messenger said, “Isn’t this Bathsheba, the daughter of Eliam, the wife of Uriah the Hittite?”

11:4 David sent some messengers to get her. She came to him and he had sexual relations with her. (Now at that time she was in the process of purifying herself from her menstrual uncleanness.) Then she returned to her home. 11:5 The woman conceived and then sent word to David saying, “I’m pregnant.”

2 Samuel 11:27

11:27 When the time of mourning passed, David had her brought to his palace. She became his wife and she bore him a son. But what David had done upset the Lord.