Samuel Morse received the patent for the telegraph on this day in 1840. Morse's work wasn't the first effort at sending messages across great distances, and there was a nascent electrical telegraph system already growing in Britain. But the system that Morse patented, "Improvement in the Mode of Communicating Information by Signals By the Application of Electro-Magnetism," would be the fastest to grow, and the code he developed to communicate across telegraph lines would see widespread use.
Morse's system used just one wire, where other systems required several wires (meaning many more dollars). Two years after his patent, he connected two rooms in the Capitol with a wire to demonstrate his system. Congress would then approve a project to build a 38-mile telegraph to connect Baltimore, Md. and Washington, D.C., which was a huge success. From there, wires were spread across the country.
You can see Morse's first telegraph, and his patent, in the National Museum of American History.