Plans to develop biological weapons and instructions on how to weaponize the bubonic plague from infected animals were found on a laptop belonging to a Tunisian Islamic State jihadist, by a Syrian rebel commander from a moderate group in northern Syria.

The laptop was seized during an attack on an IS hideout in Idlib province, near the Turkish border, in January, according to the Syrian commander, dubbed Abu Ali, Foreign Policy Magazine reported.

He said IS men fled the building before it was attacked by his men.

Among the over 30,000 files found on the machine — including a trove of documents containing jihadist propaganda, instructions on bomb-making, training for deadly campaigns and lessons on how to use disguises to evade capture — Foreign Policy said it found evidence that the laptop user was teaching himself about biological weapons, “in preparation for a potential attack that would have shocked the world.”

Information gleaned from the laptop revealed that it belonged to a Muhammad S, a Tunisian national with a background in physics and chemistry. Details indicated he joined the Islamic State after having left Tunisia sometime in 2011.

A 19-page document in Arabic on the laptop detailed the “advantages” of the deadly weapons and included instructions of how to test them safely, before use in an attack.

“The advantage of biological weapons is that they do not cost a lot of money, while the human casualties can be huge,” the document stated, according to the magazine. “When the microbe is injected in small mice, the symptoms of the disease should start to appear within 24 hours,” the document went on.

Among the files was also a 26-page fatwa by Saudi jihadi cleric Nasir al-Fahd justifying the use of such weapons. He is currently imprisones in Saudi Arabia.

“If Muslims cannot defeat the kafir [unbelievers] in a different way, it is permissible to use weapons of mass destruction,” stated the fatwa.

“Even if it kills all of them and wipes them and their descendants off the face of the Earth,” it went on.

According to Tunisian state security, some 3,000 nationals were fighting in Syria, the majority under the banner of the Islamic State.