The Islamic State terrorist group has attempted to codify the sexual relations between its fighters and women they capture, by issuing a special ruling on when it’s OK to rape a female slave.

A "fatwa," which is what a learned interpretation of the Islamic law is called, was released by Islamic State (IS, formerly ISIS/ISIL) in late January as “some of the brothers have committed violation in the matter of treatment of the female slaves. These violations are not permitted by Sharia law because these rules have not been dealt with in ages.”

“Are there any warnings pertaining to this matter?” the authors of the document wondered.

The ruling, which was among a batch of terrorist papers obtained by the US Special Operations Forces during a raid in Syria in May, was viewed by Reuters.

In the fatwa, the enslaved women and children of the infidels have been called “one of the graces which Allah have bestowed” upon the Islamic State.

According to the UN, the jihadists have abducted thousands of women and girls as young as 12 years old, selling them as sex slaves or giving to own militants as rewards.

The IS theologians from the Committee of Research and Fatwas have come up with over a dozen rules, which the fighters are to follow in order to make their sexual practices comply with the group’s laws.

READ MORE: ISIS sets up ‘spoils of war’ dept to handle slaves, stolen treasure

The fatwa forbids the owners of female slaves from having intercourse with a woman when she is menstruating.

Sexual contact with a pregnant captive carrying a child is also forbidden, with the document stressing that “it’s not permissible to cause her to abort if she’s pregnant.”

“If the owner of a female captive, who has a daughter suitable for intercourse, has sexual relations with the latter, he is not permitted to have intercourse with her mother and she is permanently off limits to him,” the paper said.

According to the ruling, a fighter who owns two sisters, could only have intercourse with one of them.

The father is restricted from engaging in sexual relations with a slave owned by his son and vice versa, the fatwa No. 64, dated January 29, 2015, said.

#ISIS sanctions organ harvesting from living ‘apostates’… even if it kills them https://t.co/hs2POrfrZxpic.twitter.com/FTxxgrXRJ0 — RT (@RT_com) December 26, 2015

Joint owners of a female captive are both banned from intercourse with her as she is viewed as "part of a joint ownership."

The slave owners were also instructed to “show compassion towards her (female captive), be kind to her, not humiliate her, and not assign her work she is unable to perform."

The women shouldn’t be sold to individuals about whom it’s known that they’ll mistreat the female slave, the fatwa concluded.

The document was among a number of bizarre rulings by Islamic State, which recently became available to the press.

One of the fatwas, for example, justified harvesting organs from infidels in order to save the life a Muslim.

"The apostate's life and organs don't have to be respected and may be taken with impunity," it said.