On April 14, 1865, Abraham Lincoln was shot at Ford's Theater in Washington, D.C. He'd die the next morning.
But also on April 14, 1865, Lincoln signed into law a piece of legislation which created the Secret Service -- the law enforcement agency charged with defending the President from, among other things, assassination attempts such as the one that befell Lincoln that evening. Was Lincoln also a victim of bad timing? Perhaps he had ESP? Not really -- rather, it's a strange historical coincidence. While we currently think of the Secret Service as primarily existing to protect the President, that was not its original intent.
During the early to mid-1800s, roughly a third of American money was counterfeit. The solution was something similar to today's approach to large scale problems -- form a commission. On the urging of Secretary of the Treasury Hugh McCulloch, Lincoln did exactly that. The conclusion was to form a federal law enforcement division (at the time, there was no FBI), the "Secret Service of Division of the Department of the Treasury." That Division was born just hours before John Wilkes Booth fatally shot the President.
The Secret Service carried out their Treasury duties, primarily, for the next 35 years. While Lincoln's assassination sparked a discussion about the need for a permanent security detail for the President, this need went unfulfilled for decades. In the interim period, both James A. Garfield (1881) and William McKinley (1901) were assassinated. The latter caused Congress to work toward a solution, and, informally, Presidential security became a duty of the Service starting with Harding's successor, Theodore Roosevelt.
The Service's mission still includes "investigations into crimes against the financial infrastructure of the United States."
Bonus fact: During the American Revolution, then-General Washington had a security detail which traveled with him, called the "Command-in-Chief's Guard." The Guard was disbanded in 1783, after the War. But it was not free of controversy. One of the Guardsmen, Thomas Hickey, was caught counterfeiting (another coincidence!) and incarcerated. While incarcerated, he confessed to another inmate that he was plotting to defect to the British. He was executed in June of 1776.
Abraham Lincoln Created The Secret Service The Day He Was Shot