Smelting is a form of extractive metallurgy; its primary use is to produce a base metal from its ore. This includes the production of silver, iron, copper, and other base metals from their ores. Smelting uses heat and a chemical reducing agent to decompose the ore, driving off other elements as gases or slag and leaving just the metal base behind.
The reducing agent is commonly a carbon source such as coke or, in earlier times, charcoal. The carbon (or carbon monoxide derived from it) removes oxygen from the ore, leaving behind the elemental metal. The carbon is thus oxidized in two stages, producing carbon monoxide and carbon dioxide. As most ores are impure, it is often necessary to use flux, such as limestone, to remove the accompanying rock gangue as slag.