The steam engine was one of the main enabling technologies of the industrial revolution. Many histories of the Industrial Revolution chart the steam engine's rise with James Watt. However, Thomas Newcomen is often credited with inventing the steam engine. So who did it?
Both Newcomen and Watt invented 'steam' engines. Both operated by injecting steam into a cylinder, moving a piston in the cylinder.
Newcomen's engine is often described as a steam engine but the steam pressure is not really performing the work. Instead, the steam is condensed (by injecting a small amount of water) to produce a partial vacuum. This partial vacuum pulls the piston (to perform work).
Newcomen's design was actually an incremental improvement of a thermic syphon designed by Thomas Savery. Newcomen added a piston into the vacuum container (/cylinder), and used a rocking beam to operate the pump mechanism (most Newcomen engines were used as water pumps for mines).
Watt realized that the condensing arrangement was very inefficient because most of the heat was used heating the cylinder which was then cooled during the condensing stage. Although thermodynamics was at a very primitive stage, Watt realised the importance of latent heat during this condensing process. He operated the cylinder at steam temperature with a steam jacket, and moved the condensing stage out of the cylinder.
The piston was now operated by steam being admitted into the cylinder. Although initial steam pressures were not much higher, this was significantly more efficient than the Newcomen arrangement. As technology improved and safety valves were invented (and improved!), pressures increased for greater power and efficiency: early steam locomotives (early 19th century) often operated at or below 50psi, whilst 200-250psi was common during the 20th century.
Watt initially had a lot of trouble getting his designs to work. The primary problem was the creation of a large cylinder with a steam-tight piston. This was eventually solved by partnering with Boulton. Boulton also introduced the idea of converting the reciprocating beam motion into a rotating wheel motion - suitable for use in mills.
Practical steam power predates both Watt and Newcomen. Neither one invented it.
Taqi al-Din, an Ottoman, described a rotary steam thing that rotated a barbeque spit. This was in the year 1551. Apparently the device had vanes on a wheel, and a jet of steam hit the vanes. So this would be the first impulse-type steam turbine.
I would call that the first practical use of a steam engine, but not enough for an industrial revolution. It could have been... It could have been the beginning if people saw it and tried to improve it, like make it bigger, and apply it to something like a paddlewheel boat. But apparently no one did.
Also, it is not the first practical use of steam itself. Steam cooking goes way, way back. Pretty sure dried tea leaves were steamed in China to make all sorts of tea. Steam cooking is different from just boiling something in water. Steam cooking involves the steam itself heating and moistening the foodstuff in a different way than in boiling water.
Jeronimo Beaumont, a Spaniard, got a patent for a steam-powered water pump that was used to drain mines. This was in 1606. The wikipedia citation says "Garcia, Nicolas (2007). Mas alla de la Leyenda Negra. Valencia: Universidad de Valencia. pp. 443–454. ISBN 9788437067919." I don't have the book so I wish I could tell you how that steam engine worked. This is pretty amazing to me, as it predates Savery and Necommen by about 100 years...so amazing in fact that I might open a question about it.
Ferdinand Verbiest designed a steam-powered toy car, 65 cm long, for the Chinese Emperor around 1672. You can see from the drawing that a jet of steam hits paddlewheels. This makes it an impulse-type turbine. (Hero's aeliopile was a reaction-type turbine.) Wikipedia says that no one knows if the toy was ever actually built, with no citation.
Thomas Savery built a steam engine in 1698 called "The Miner's Friend" and got a patent for it. It was very similar to the one that Newcomen would soon build. In fact, Newcomen went into partnership with Savery due to the patent.
(I got most of this knowledge from the wiki article on History of the Steam Engine. It mentions a lot more stuff too, like a Frenchman who heated small sealed boilers until they exploded, demonstrating that steam pressure can do stuff.)
So you see, the inventor of steam engines is not Newcomen or Watt, but at the latest, Beaumont. I don't know if Savery knew of Beaumont's steam engine. If not, then he can be credited as an independent inventor.
So no offense, but I think the other answer by winwaed is wrong. Even if an improvement can be called an invention in its own right, you still have to credit Savery's and Beaumont's engines as predating them. To the best of my knowledge, they are originals in the sense that they were both independently invented without drawing on each other, or drawing on any other steam engine (not necessarily steam-use thing) invented beforehand.
BTW, it is incorrect to refer to Newcomen's engine as having a piston. Neither Savery's nor Newcomen's engine had a piston. Steam is not pushing against that disc inside the cylinder. It's the cooling of steam that creates less pressure in the cylinder, which lets the outside atmospheric pressure push the disc down. This is why it's sometimes known as the "Atmospheric Engine". It's atmospheric pressure doing the pushing.
I believe it was Watt who first applied steam directly onto pistons. Maybe this is where the confusion comes from and why Watt is credited as an inventor "steam power", by which they mean a modern configuration of steam power.
There is a Hellenistic Egypt "aeolipile" described by Heron of Alexandria from ~300BC to ~100AD, which beats Taqi al-Din (born 1526 AD) by no less than ~1400 years.