Considering the Civil War had ended only a few days earlier, April 14, 1865, was a normal day in the White House. President Abraham Lincoln read his newspapers, ate his breakfast, met with his cabinet. He also signed a piece of legislation authorizing a government agency that would gain its fame for protecting the President of the United States. Ironically, Lincoln’s authorization of the United States Secret Service would be one of his last official acts—that evening, he was assassinated by John Wilkes Booth while watching Our American Cousin in Ford’s Theatre in Washington, D.C.

Even if Lincoln had authorized the Secret Service earlier, it’s doubtful it could have prevented his assassination Though the job performance of Lincoln’s bodyguards will remain a subject of eternal debate, it was unthinkable that an actor in a play would try to murder the President. And though presidential security tightened after Lincoln’s death, the Secret Service he authorized wasn’t originally intended to guard the president at all. In fact, it had a much more mundane mission: investigate and stop counterfeit money.

By 1865, up to one-third or even one-half of American money in circulation was fake. This was partly due to an old system of relying on state banks to produce money using approved designs and paper provided by the Federal Government. But though the country adopted a national currency in 1863, federal dollars were as easy to counterfeit as state-produced ones. Spurred by the daredevil escape of counterfeiter Pete McCartney, who eluded federal guards and was rumored to have produced as much as $100,000 in faux cash, Lincoln called a commission to figure out a fix for the fake money problem. Treasury Secretary Hugh McCulloch came up with a solution—a “regular permanent force whose job it [would] be to put these counterfeiters out of business.”

At first, the Secret Service focused on money, but in 1867 its mission was broadened to include “detecting persons perpetrating fraud against the government.” Over the years, despite a lack of statutory funding, the Secret Service assumed more and more responsibility, gaining recognition as a distinct organization and being given badges and commissions. After the assassination of William McKinley, in 1901, Congress requested that the Secret Service protect the President himself.

Though the Secret Service has long been charged with protecting the President and presidents-elect, it isn’t always beloved by officials. Theodore Roosevelt called it a “very small but very necessary thorn in the flesh,” but assumed the Secret Service would “not be the least use” if there were a serious attempt on his life. General George Patton called the Service “a bunch of cheap detectives, always smelling of drink.” And John F. Kennedy, whom the Secret Service called “Lancer,” was impatient with the Secret Service, preferring motorcades and intimate crowd interaction to carefully monitored public appearances. More recently, it’s been a rocky few years for the Secret Service, with scandals related to car crashes, drones, and prostitution. This week, the agency made news for allowing a child to breach a barricade—the second time in under a year that a rogue toddler has made it onto the grounds of the White House.

But for every Secret Service debacle, there’s been a close call. The agency has foiled repeated presidential threats, from a plot to assassinate Grover Cleveland to a recent plot against President Obama. And though they have sometimes characterized themselves as “babysitters[s] with a gun,” the agency does much more, from arranging housing to observing official protocol.

And lest you think that Secret Service agents are just burly guys in suits—they still chase down counterfeiters. Recently, the agency has been on the case of counterfeiters circulating fake $100 bills in Rochester, N.Y.

Contact us at letters@time.com.