Oxygen was discovered by Swedish chemist Carl Wilhelm Scheele in 1772. He discovered that by heating mercuric oxide, a gas (later identified as oxygen) formed. Scheele called the gas "fire air" because it produced sparks as it came in contact with hot charcoal dust.
This story starts with Plato and his ideas on the nature of matter. Plato was a Greek philosopher who suggested that all matter was made of four essential elements — fire, air, earth, and water. This crude idea lasted for several centuries, almost uncontested, and spawned the Phlogiston theory, which in ancient Greek meant “burning up.”
The main precept of Phlogiston theory was that fire was itself an element, so at the time when something burned, the flames were considered evidence that fire (as an element) was being separated from the material. This was the popular belief until Scheele's experiment led French chemist Antoine-Laurent Lavoisier to prove, in 1779, that when oxygen was isolated, fire could be seen as a consequence of a chemical reaction, instead of as an element in the reaction. It was Lavoisier who named the element, oxygen.
By throwing out the Phlogiston theory, Lavoisier paved the way for modern chemistry. That made for dramatic changes in the science thereafter, and it was due in large part to the discovery of oxygen.