2 Samuel 8:1 In the course of time, David defeated the Philistines and subdued them, and he took Metheg Ammah from the control of the Philistines. 2 David also defeated the Moabites. He made them lie down on the ground and measured them off with a length of cord. Every two lengths of them were put to death, and the third length was allowed to live. So the Moabites became subject to David and brought tribute.
Think about this. David defeated the Moabites and then lined them up on the ground and killed them according to how happened to fall under a measuring line! How cruel is that? It sounds like something the Nazis would do for fun, like randomly lining up the Jews and then killing two out of three so the survivors could see the horror of it all.
And worse, God clearly approved of his behavior because the immediate context twice states that "the LORD gave David victory wherever he went."