On September 6, 1901, President William McKinley was shot twice in the abdomen while greeting the public in a receiving line at the Temple of Music, an auditorium at the Pan-American Exposition in Buffalo, New York. The shooter, Leon Czolgosz, an anarchist who had lost his factory job during the 1893 economic panic and had become influenced by anarchist speeches, concealed a .32-caliber Iver Johnson revolver beneath a handkerchief wrapped around his hand. As McKinley reached for Czolgosz's other hand, Czolgosz fired twice; one bullet grazed the president after deflecting off a button, and the second entered his abdomen. Czolgosz was immediately subdued by bystanders, including James Parker, a detective, and a soldier, and was heard to say "I done my duty."
McKinley was taken to the Exposition's hospital, where surgeon Matthew D. Mann operated that evening. Doctors repaired damage to McKinley's stomach but could not locate the second bullet, which they believed had lodged in his back muscles. For several days McKinley appeared to be recovering, and dignitaries including Vice President Theodore Roosevelt left Buffalo believing the crisis had passed. However, McKinley's condition deteriorated on September 13 as gangrene developed along the path of the undiscovered bullet, spreading toxins through his body. He died at 2:15 a.m. on September 14, 1901. An autopsy found the bullet had passed through the stomach, colon, a kidney, and damaged the pancreas and adrenal glands; it also revealed McKinley suffered from cardiomyopathy, which doctors believed compromised his ability to recover. Theodore Roosevelt was sworn in as president later that day.
Czolgosz went on trial for murder in state court in Buffalo on September 23, 1901. The defense called no witnesses, and after roughly half an hour of jury deliberation, Czolgosz was convicted of first-degree murder. He was sentenced to death and executed by electric chair on October 29, 1901; acid was placed in his casket before burial in the prison graveyard.
In the aftermath, Buffalo police initially suspected Czolgosz had not acted alone, and several anarchists, including Emma Goldman—whose Cleveland speech Czolgosz had attended and who he said had influenced him—were arrested. Goldman turned herself in on September 10 and spent nearly three weeks in jail before being released without charge, as were the other detained individuals. The assassination prompted a broader backlash against anarchists, including vigilante attacks on anarchist colonies and newspapers, and contributed to surveillance programs that were eventually consolidated into the Federal Bureau of Investigation in 1908. Newspaper editorials criticized the lack of protection afforded to McKinley, and although the Secret Service began providing full-time protection to President Roosevelt by 1902, Congress did not formally designate the Secret Service as responsible for presidential security until 1906.