The following spring, at the time of the year when kings usually go to war, David sent out Joab with his officers and the Israelite army; they defeated the Ammonites and besieged the city of Rabbah. But David himself stayed in Jerusalem. 1
References for 2 Samuel 11:1
11.1 1 Ch 20.1.
One day, late in the afternoon, David got up from his nap and went to the palace roof. As he walked around up there, he saw a woman taking a bath in her house. She was very beautiful.
So he sent a messenger to find out who she was, and learned that she was Bathsheba, the daughter of Eliam and the wife of Uriah the Hittite.
David sent messengers to get her; they brought her to him and he made love to her. (She had just finished her monthly ritual of purification.) Then she went back home.
Afterward she discovered that she was pregnant and sent a message to David to tell him.
David then sent a message to Joab: "Send me Uriah the Hittite." So Joab sent him to David.
When Uriah arrived, David asked him if Joab and the troops were well, and how the fighting was going.
Then he said to Uriah, "Go on home and rest a while." Uriah left, and David had a present sent to his home.
But Uriah did not go home; instead he slept at the palace gate with the king's guards.
When David heard that Uriah had not gone home, he asked him, "You have just returned after a long absence; why didn't you go home?"
Uriah answered, "The men of Israel and Judah are away in battle, and the Covenant Box is with them; my commander Joab and his officers are camping out in the open. How could I go home, eat and drink, and sleep with my wife? By all that's sacred, I swear that I could never do such a thing!"
So David said, "Then stay here the rest of the day, and tomorrow I'll send you back." So Uriah stayed in Jerusalem that day and the next.
David invited him to supper and got him drunk. But again that night Uriah did not go home; instead he slept on his blanket in the palace guardroom.
References for 2 Samuel 11:13
The next morning David wrote a letter to Joab and sent it by Uriah.
He wrote: "Put Uriah in the front line, where the fighting is heaviest, then retreat and let him be killed."
So while Joab was besieging the city, he sent Uriah to a place where he knew the enemy was strong.
The enemy troops came out of the city and fought Joab's forces; some of David's officers were killed, and so was Uriah.
Then Joab sent a report to David telling him about the battle,
and he instructed the messenger, "After you have told the king all about the battle,
he may get angry and ask you, "Why did you go so near the city to fight them? Didn't you realize that they would shoot arrows from the walls?
Don't you remember how Abimelech son of Gideon was killed? It was at Thebez, where a woman threw a millstone down from the wall and killed him. Why, then, did you go so near the wall?' If the king asks you this, tell him, "Your officer Uriah was also killed.' " 2
References for 2 Samuel 11:21
11.21 Jg 9.53.
So the messenger went to David and told him what Joab had commanded him to say.
He said, "Our enemies were stronger than we were and came out of the city to fight us in the open, but we drove them back to the city gate.
Then they shot arrows at us from the wall, and some of Your Majesty's officers were killed; your officer Uriah was also killed."
David said to the messenger, "Encourage Joab and tell him not to be upset, since you never can tell who will die in battle. Tell him to launch a stronger attack on the city and capture it."
When Bathsheba heard that her husband had been killed, she mourned for him.
When the time of mourning was over, David had her brought to the palace; she became his wife and bore him a son. But the Lord was not pleased with what David had done.