There is an independent invention theory supporting an Islamic origin of the gun, citing the Mamluk deployment of hand cannons in 1260 and a passage by Ibn Khaldun on the Marinid Siege of Sijilmassa in 1274: "[ The Sultan] installed siege engines … and gunpowder engines …, which project small balls of iron. These balls are ejected from a chamber … placed in front of a kindling fire of gunpowder; this happens by a strange property which attributes all actions to the power of the Creator." The passage, dated to 1382, and its interpretation has been rejected as anachronistic by most historians, who urge caution regarding claims of Islamic firearms use in the 1204–1324 period as late medieval Arabic texts used the same word for gunpowder, naft, as they did for an earlier incendiary, naphtha. Needham believes Ibn Khaldun was speaking of fire lances or proto-guns rather than hand cannon.
Historian Ahmad Y. al-Hassan, based on his analysis of 14th-century Arabic manuscripts which he argues to be copies of earlier texts, claims that hand cannons were used at the Battle of Ain Jalut in 1260. However Hassans claims have been refuted by other historians such as David Ayalon, Iqtidar Alam Khan, Joseph Needham, Tonio Andrade, and Gabor Ágoston. Khan argues that it was the Mongols who introduced gunpowder to the Islamic world, and believes cannons only reached Mamluk Egypt in the 1370s. According to Needham, fire lances or proto-guns were known to Muslims by the late 13th century and early 14th century. However the term midfa, dated to textual sources from 1342 to 1352, cannot be proven to be true hand-guns or bombards, and contemporary accounts of a metal-barrel cannon in the Islamic world do not occur until 1365. Needham also concludes that in its original form the term midfa' refers to the tube or cylinder of a naphtha projector (flamethrower), then after the invention of gunpowder it meant the tube of fire lances, and eventually it applied to the cylinder of hand-gun and cannon. Similarly, Andrade dates the textual appearance of cannon in middle eastern sources to the 1360s.  Gabor Ágoston and David Ayalon believe the Mamluks had certainly used siege cannon by the 1360s, but earlier uses of cannon in the Islamic World are vague with a possible appearance in the Emirate of Granada by the 1320s, however evidence is inconclusive.