It happened in the spring of the year, at the time when kings go out to battle, that David sent Joab and his servants with him, and all Israel; and they destroyed the people of Ammon and besieged Rabbah. But David remained at Jerusalem.
Then it happened one evening that David arose from his bed and walked on the roof of the king’s house. And from the roof he saw a woman bathing, and the woman was very beautiful to behold. So David sent and inquired about the woman. And someone said, “Is this not Bathsheba, the daughter of Eliam, the wife of Uriah the Hittite?” Then David sent messengers, and took her; and she came to him, and he lay with her, for she was cleansed from her impurity; and she returned to her house. And the woman conceived; so she sent and told David, and said, “I am with child.”
Then David sent to Joab, saying, “Send me Uriah the Hittite.” And Joab sent Uriah to David. When Uriah had come to him, David asked how Joab was doing, and how the people were doing, and how the war prospered. And David said to Uriah, “Go down to your house and wash your feet.” So Uriah departed from the king’s house, and a gift of food from the king followed him. But Uriah slept at the door of the king’s house with all the servants of his lord, and did not go down to his house. So when they told David, saying, “Uriah did not go down to his house,” David said to Uriah, “Did you not come from a journey? Why did you not go down to your house?”
And Uriah said to David, “The ark and Israel and Judah are dwelling in tents, and my lord Joab and the servants of my lord are encamped in the open fields. Shall I then go to my house to eat and drink, and to lie with my wife? As you live, and as your soul lives, I will not do this thing.”
Then David said to Uriah, “Wait here today also, and tomorrow I will let you depart.” So Uriah remained in Jerusalem that day and the next. Now when David called him, he ate and drank before him; and he made him drunk. And at evening he went out to lie on his bed with the servants of his lord, but he did not go down to his house.
In the morning it happened that David wrote a letter to Joab and sent it by the hand of Uriah. And he wrote in the letter, saying, “Set Uriah in the forefront of the hottest battle, and retreat from him, that he may be struck down and die.” So it was, while Joab besieged the city, that he assigned Uriah to a place where he knew there were valiant men. Then the men of the city came out and fought with Joab. And some of the people of the servants of David fell; and Uriah the Hittite died also.
Then Joab sent and told David all the things concerning the war, and charged the messenger, saying, “When you have finished telling the matters of the war to the king, if it happens that the king’s wrath rises, and he says to you: ‘Why did you approach so near to the city when you fought? Did you not know that they would shoot from the wall? Who struck Abimelech the son of Jerubbesheth? Was it not a woman who cast a piece of a millstone on him from the wall, so that he died in Thebez? Why did you go near the wall?’—then you shall say, ‘Your servant Uriah the Hittite is dead also.’”
So the messenger went, and came and told David all that Joab had sent by him. And the messenger said to David, “Surely the men prevailed against us and came out to us in the field; then we drove them back as far as the entrance of the gate. The archers shot from the wall at your servants; and some of the king’s servants are dead, and your servant Uriah the Hittite is dead also.”
Then David said to the messenger, “Thus you shall say to Joab: ‘Do not let this thing displease you, for the sword devours one as well as another. Strengthen your attack against the city, and overthrow it.’ So encourage him.”
When the wife of Uriah heard that Uriah her husband was dead, she mourned for her husband. And when her mourning was over, David sent and brought her to his house, and she became his wife and bore him a son. But the thing that David had done displeased the Lord.
-2 Samuel 11:1-27 (NKJV)