And David had many mighty men. And Abishai the brother of Joab was the chief among them. And when David fought against the Philistines three of the mighty men went down, and came to David in the harvest time unto the cave of Adullam: and the troop of the Philistines pitched in the valley of Rephaim. And David was then in an hold, and the garrison of the Philistines was then in Beth-lehem. And David longed, and said, Oh that one would give me drink of the water of the well of Beth-lehem, which is by the gate! And the three mighty men brake through the host of the Philistines, and drew water out of the well of Beth-lehem, that was by the gate, and took it, and brought it to David: nevertheless he would not drink thereof, but poured it out unto the LORD.
AND again the anger of the LORD was kindled against Israel, and he moved David against them to say, Go, number Israel and Judah. And Joab and the captains of the host went out from the presence of the king, to number the people of Israel. So when they had gone through all the land, they came to Jerusalem at the end of nine months and twenty days. And Joab gave up the sum of the number of the people unto the king: and there were in Israel eight hundred thousand valiant men that drew the sword; and the men of Judah were five hundred thousand men.
And David's heart smote him after that he had numbered the people. And David said unto the LORD, I have sinned greatly in that I have done: and now, I beseech thee, O LORD, take away the iniquity of thy servant; for I have done very foolishly. For when David was up in the morning, the word of the LORD came unto the prophet Gad, David's seer, saying, Go and say unto David, Thus saith the LORD, I offer thee three things; choose thee one of them, that I may do it unto thee. So Gad came to David, and told him, and said unto him, Shall seven years of famine come unto thee in thy land? or wilt thou flee three months before thine enemies, while they pursue thee? or that there be three days' pestilence in thy land? now advise, and see what answer I shall return to him that sent me. And David said unto Gad, I am in a great strait: let us fall now into the hand of the LORD; for his mercies are great: and let me not fall into the hand of man.