Gunpowder was invented in China. Chinese military forces used gunpowder-based weapons (i.e. rockets, guns, cannons) and explosives (i.e. grenades and different types of bombs) against the Mongols when the Mongols attempted to invade and breach city fortifications on China's northern borders. After the Mongols conquered China and founded the Yuan Dynasty, they used the Chinese gunpowder-based weapons technology in their attempted invasion of Japan; they also used gunpowder to fuel rockets.
The mainstream scholarly consensus is that gunpowder was invented in China, spread through the Middle East, and then into Europe, although there is a dispute over how much the Chinese advancements in gunpowder warfare influenced later advancements in the Middle East and Europe. The spread of gunpowder across Asia from China is widely attributed to the Mongols. One of the first examples of Europeans encountering gunpowder and firearms is at the Battle of Mohi in 1241. At this battle the Mongols not only used gunpowder in early Chinese firearms but in the earliest grenades as well.
A major problem confronting the study of the early history of gunpowder is ready access to sources close to the events described. Often enough, the first records potentially describing use of gunpowder in warfare were written several centuries after the fact, and may well have been colored by the contemporary experiences of the chronicler. It is also difficult to accurately translate original alchemy texts, especially medieval Chinese texts which employ metaphor to describe unexplained phenomena, into contemporary scientific language with its rigidly defined terminology.
The difficulty in translation has given rise to errors or loose interpretations bordering on artistic licence. Early writings potentially mentioning gunpowder are sometimes marked by a linguistic process where old words acquired new meanings. For instance, the Arabic word naft transitioned from denoting naphta to denoting gunpowder, and the Chinese word pao evolved from meaning catapult to referring to cannon.
Gunpowder production in Britain appears to have started in the mid 14th century AD with the aim of supplying The English Crown. Records show that gunpowder was being made, in England, in 1346, at the Tower of London; a powder house existed at the Tower in 1461; and in 1515 three King's gunpowder makers worked there. Gunpowder was also being made or stored at other Royal castles, such as Portchester.