The first steam engine was invented by Thomas Savery in 1698, and it was based on a design by Denis Papin from a year earlier. Savery's engine was built to pump water out of coal mines, had no moving parts and used large amounts of coal to move very little water.
Thomas Newcomen improved on Thomas Savery's engine by creating what he called the atmospheric steam engine. This was also used to pump water from coal mines but was more efficient than the earlier crude steam engine. Newcomen, together with John Calley, installed his first engine at the top of a mine in 1712.