The first practical, fully automatic machine gun, the Maxim gun, was invented in 1884 by Hiram Stevens Maxim, a British inventor of American origin.
Here's a more detailed look at the invention and its context:
Hiram Stevens Maxim:
An American-born British inventor, Maxim is best known for his invention of the Maxim gun, a recoil-operated, fully automatic machine gun.
Maxim Gun:
It was the first fully automatic machine gun, using its own recoil energy to load, fire, and eject cartridges from a 250-round canvas belt.
It was manufactured by Vickers and was sometimes known as the Vickers-Maxim or just Vickers.
The Maxim gun was recoil-operated and was cooled by a water jacket surrounding the barrel.
Impact:
The Maxim gun was heavily used by colonial powers during the "Scramble for Africa" and later by different armies during the Russo-Japanese War, the First and Second World Wars, as well as in contemporary conflicts.
It was a significant development in military technology, profoundly altering the character of modern warfare.
Precursors:
The French mitrailleuse and the American Gatling gun, both developed in the 1860s, were precursors to the machine gun.
The Gatling gun, invented by Richard Gatling, had several barrels mounted around a central axle and revolved by means of a hand crank.
The Gatling gun was a hand-operated machine gun, while the Maxim gun was the first fully automatic, recoil-operated machine gun.
Other Developments:
The Maxim gun was quickly followed by other machine gun designs, such as the Hotchkiss, Lewis, Browning, Madsen, and Mauser guns.