Some of them also related that he wished for Uriah to be killed so that he could marry his wife; this, they said, was the extent of his sin.
Others related that David wrote to his nephew Job: “Send Uriah to such-and-such a place, and place him at the forefront before the Ark.” Whoever was placed before the Ark was not permitted to retreat until Allah granted victory at his hands or he was martyred. So Job sent him forth and placed him there, and victory was granted to him. Job then wrote to David informing him of this, whereupon David wrote back, again instructing him to send Uriah against such-and-such an enemy. He sent him, and victory was granted to him. Job wrote to David with the news, and David again wrote to him, instructing him to send Uriah against another enemy, fiercer in battle than the first. He sent him, and Uriah was killed on the third occasion. When the woman’s waiting period had ended, David married her. She was the mother of Solomon, peace be upon him. (1)
It is related from Ibn Mas‘ud, may Allah be pleased with him, that he said: David’s sin was that he asked the man to relinquish his wife in his favor.
The exegetes said: This was permissible for them, but Allah, exalted is He, did not approve of it for him, because he had a worldly desire and desired an increase in wives, although Allah had made him independent of her through the other women He had given him.
It is related from al-Hasan concerning the reason for David’s trial, peace be upon him, that he had divided his time into portions: a day for his wives, a day for worship, a day for judging among the Children of Israel, and a day for the Children of Israel, when he would admonish them and they would admonish him, and he would move them to tears and they would move him to tears. When it was the day of the Children of Israel, they admonished him and said, “Does there come upon a person a day in which he commits no sin?” David then resolved within himself 101/a that he would be capable of this. (2)
It was also said that they mentioned the temptation of women, and David resolved within himself that, if he were tested, he would hold fast to Allah’s protection. When his day of worship came, he shut his doors and commanded that no one be allowed to enter upon him. He devoted himself to the Torah, and while he was reading, a golden dove entered upon him, as previously mentioned. It was said that he had sent her husband in command of one of his armies, and he wrote to him, ordering him to march to such-and-such a place, where he would be killed if he went. He did so and was struck down, and David married his wife.
They said: When David consummated his marriage to Uriah’s wife, only a short time passed before Allah sent to him two angels in the form of two men, on his day of worship. They sought permission to enter, but the guards prevented them, so they scaled the wall of the prayer chamber and came upon him. While he was praying, he suddenly found them seated before him. It is said that they were Gabriel and Michael. This is the meaning of His saying, exalted is He: “Has the story of the litigants reached you?”—that is, the account of the litigants—“when they scaled the wall of the prayer chamber”: that is, they climbed up and over it. One says, “I scaled the wall or rampart,” when one climbs over it. The verb is in the plural although they were two, because the word “litigant” may apply to one, two, or many