Fireworks were invented over 2,000 years ago in ancient China. The earliest form was natural "firecrackers," which were bamboo stalks that exploded when thrown into fire due to the overheating of air pockets inside the bamboo. Later, between 600 and 900 AD, Chinese alchemists discovered gunpowder by mixing potassium nitrate, sulfur, and charcoal, and started filling paper tubes or bamboo shoots with this powder to create the first manufactured fireworks. These early fireworks were used to celebrate significant events and to ward off evil spirits. The origin of fireworks is thus traced back to ancient Chinese inventions between the 2nd century BC and the 9th century AD.