David's sin with Bathsheba and Uriah
While Joab's army besieged Rabbah, David took Bathsheba and tried to conceal her pregnancy. When Uriah would not go home from battle, David arranged his death and took Bathsheba as his wife, but the deed displeased the LORD (2 Samuel 11:1-27), in the 1035 BC war context.
1In the spring, at the time when kings march out to war, David sent out Joab and his servants with the whole army of Israel. They destroyed the Ammonites and besieged Rabbah, but David remained in Jerusalem. 2One evening David got up from his bed and strolled around on the roof of the palace. And from the roof he saw a woman bathing—a very beautiful woman. 3So David sent and inquired about the woman, and he was told, “This is Bathsheba, the daughter of Eliam and the wife of Uriah the Hittite.”