In the spring, when kings go off to war, David sent Joab, along with his servants and all the Israelites, and they destroyed the Ammonites, attacking the city of Rabbah. But David remained in Jerusalem.
References for 2 Samuel 11:1
One evening, David got up from his couch and was pacing back and forth on the roof of the palace. From the roof he saw a woman bathing; the woman was very beautiful.
David sent someone and inquired about the woman. The report came back: "Isn't this Eliam's daughter Bathsheba, the wife of Uriah the Hittite?"
So David sent messengers to get her. When she came to him, he had sex with her. (Now she had been purifying herself after her monthly period.) Then she returned home.
The woman conceived and sent word to David. "I'm pregnant," she said.
Then David sent a message to Joab: "Send me Uriah the Hittite." So Joab sent Uriah to David.
When Uriah came to him, David asked about the welfare of Joab and the army and how the battle was going.
Then David told Uriah, "Go down to your house and wash your feet." Uriah left the palace, and a gift from the king was sent after him.
However, Uriah slept at the palace entrance with all his master's servants. He didn't go down to his own house.
David was told, "Uriah didn't go down to his own house," so David asked Uriah, "Haven't you just returned from a journey? Why didn't you go home?"
"The chest and Israel and Judah are all living in tents," Uriah told David. "And my master Joab and my master's troops are camping in the open field. How could I go home and eat, drink, and have sex with my wife? I swear on your very life, I will not do that!"
References for 2 Samuel 11:11
Then David told Uriah, "Stay here one more day. Tomorrow I'll send you back." So Uriah stayed in Jerusalem that day. The next day
David called for him, and he ate and drank, and David got him drunk. In the evening Uriah went out to sleep in the same place, alongside his master's servants, but he did not go down to his own home.
The next morning David wrote a letter to Joab and sent it with Uriah.
He wrote in the letter, "Place Uriah at the front of the fiercest battle, and then pull back from him so that he will be struck down and die."
So as Joab was attacking the city, he put Uriah in the place where he knew there were strong warriors.
When the city's soldiers came out and attacked Joab, some of the people from David's army fell. Uriah the Hittite was also killed.
Joab sent a complete report of the battle to David.
"When you have finished reporting all the news of the battle to the king," Joab instructed the messenger,
"if the king gets angry and asks you, ‘Why did you go so close to the city to fight? didn't you know they would shoot from the wall?
Who killed Jerubbaal's son Abimelech? didn't a woman throw an upper millstone on top of him from the wall so that he died in Thebez? Why did you go so close to the wall?' then say: ‘Your servant Uriah the Hittite is dead too.'"
References for 2 Samuel 11:21
So the messenger set off, and when he arrived he reported to David everything Joab sent him to say.
"The men overpowered us," the messenger told David. "They came out against us in the open field, but we fought against them up to the entrance of the city gate.
References for 2 Samuel 11:23
Archers shot down on your servants from the wall. Some of the king's servants died. And your servant Uriah the Hittite is dead too."
David said to the messenger, "Say this to Joab: ‘Don't be upset about this because the sword is that way: taking the life of this person or that person. Continue attacking the city and destroy it!' Encourage Joab!"
When Uriah's wife heard that her husband Uriah was dead, she mourned for her husband.
After the time of mourning was over, David sent for her and brought her back to his house. She became his wife and bore him a son. But what David had done was evil in the LORD's eyes.