2 Samuel 12:5-15

5 Then David's anger was greatly kindled against the man; and he said to Nathan, "As the LORD lives, the man who has done this deserves to die;
6 and he shall restore the lamb fourfold, because he did this thing, and because he had no pity."
7 Nathan said to David, "You are the man. Thus says the LORD, the God of Israel, 'I anointed you king over Israel, and I delivered you out of the hand of Saul;
8 and I gave you your master's house, and your master's wives into your bosom, and gave you the house of Israel and of Judah; and if this were too little, I would add to you as much more.
9 Why have you despised the word of the LORD, to do what is evil in his sight? You have smitten Uri'ah the Hittite with the sword, and have taken his wife to be your wife, and have slain him with the sword of the Ammonites.
10 Now therefore the sword shall never depart from your house, because you have despised me, and have taken the wife of Uri'ah the Hittite to be your wife.'
11 Thus says the LORD, 'Behold, I will raise up evil against you out of your own house; and I will take your wives before your eyes, and give them to your neighbor, and he shall lie with your wives in the sight of this sun.
12 For you did it secretly; but I will do this thing before all Israel, and before the sun.'"
13 David said to Nathan, "I have sinned against the LORD." And Nathan said to David, "The LORD also has put away your sin; you shall not die.
14 Nevertheless, because by this deed you have utterly scorned the LORD, the child that is born to you shall die."
15 Then Nathan went to his house. And the LORD struck the child that Uri'ah's wife bore to David, and it became sick.