On the morning of July 2, 1881, James A. Garfield arrived at the Baltimore and Potomac train station for a much-needed holiday. Just four months had passed since the former Union general and Ohio congressman had been sworn in as the nation’s 20th president, but his term had already gotten off to a rocky start. He had clashed with Republican power brokers over patronage appointments to his administration, and had endured a brush with tragedy after his wife contracted a near-fatal case of malaria.

With the first lady now on the mend, Garfield was eager to escape the sweltering capital for a summer trip to New England, where he planned to give a speech at his alma mater, Williams College. Along with his two teenaged sons and Secretary of State James G. Blaine, he had left the White House and taken a carriage ride to the station entrance near the National Mall. Like most presidents up to that point, he was not accompanied by bodyguards or a security detail.

As Garfield’s carriage pulled up outside the Baltimore and Potomac, Charles Guiteau paced the waiting room inside, ready to fulfill what he believed was a mission from God. For weeks, the 39-year-old had stalked the president across Washington, patiently waiting for a chance to gun him down. Family members and acquaintances had long suspected that Guiteau was insane, but he had planned the crime with chilling precision. He had conducted target practice with an ivory-handled .44 caliber pistol—specially purchased because Guiteau thought it would look nice in a museum one day—and had even tried to take a tour of the district jail, which he assumed would be his new home after he was arrested.

In his pocket, Guiteau carried a letter addressed to the White House. “The president’s tragic death was a sad necessity,” it read, “but it will unite the Republican Party and save the Republic. Life is a fleeting dream, and it matters little when one goes.”

At around 9:20 a.m., Garfield entered the station alongside Secretary Blaine, who had offered to escort him to his train. As the men strode through the waiting room, Guiteau snuck up behind them and drew his pistol. “His eye was steady,” a witness later noted, “and his face presented the appearance of a brave man, who is determined upon a desperate deed, and meant to do it calmly and well.” Guiteau fired two shots at the president from point blank range. The first bullet only grazed Garfield’s right arm, causing him to bellow “My God! What is this?” The second shot was more accurate, striking Garfield in the lower back and knocking him to the floor.

No sooner had the shots rang out than the station filled with the sound of panicked screams from bystanders. Guiteau made an attempt to flee, but a man blocked the door, allowing a ticket agent and a police officer to apprehend him. Furious train passengers immediately surrounded the shooter and began yelling, “Lynch him! Lynch him!” At Guiteau’s own request, police whisked him away to the safety of the jailhouse.

Garfield, meanwhile, was still laid out on the train station floor, bleeding profusely from his back wound. Within minutes, 10 different doctors had arrived to examine him and try to locate the second bullet. Though no one knew it at the time, the slug had missed the president’s arteries and vital organs and embedded itself near his pancreas. It was a survivable injury, but the army of well-meaning physicians only worsened the damage by using their unsterilized fingers and instruments to probe the wound, introducing germs and potentially causing an infection.

After an hour of excruciating prodding, the president was carried from the train station to a bedroom at the White House. His doctors feared he would not survive the night, but Garfield put on a brave face for his children. “The upper story is alright,” he assured one of his crying sons. “It is only the hull that was damaged.”

While Garfield spent the next few days fighting for his life, details emerged about the crazed gunman. Charles J. Guiteau was an Illinois native who had spent most of his life drifting between cities and trying his hand at everything from law and preaching to living in a free love religious commune. He was a staunch Republican, and had written a speech on Garfield’s behalf during the 1880 presidential election. It was largely ignored, but Guiteau formulated the delusion that it was a key factor in the president’s victory. Following Garfield’s inauguration, Guiteau moved to Washington, D.C. and became a frequent—and decidedly unwelcome—visitor to the White House. He even wrangled a personal meeting with Garfield, during which he gave the president a copy of his speech and asked to be rewarded with a consulship in Paris.

When he was denied a government office, Guiteau’s addled mind turned to revenge. While lying in bed one night, he had what he described as a “flash” of divine inspiration: God wanted him to kill the president. Guiteau became convinced that Garfield’s death would save the country by allowing Vice President Chester A. Arthur to take his place. Even after his arrest, he continued to believe that the vice president would come to his rescue. “You stick to me,” he counseled one detective. “Arthur and all those men are my friends, and I’ll have you made Chief of Police.”

As the summer dragged on, newspapers printed a steady stream of medical updates on Garfield. The 49-year-old president had rallied in the first few days after the shooting, but his condition worsened after his doctor, D. Willard Bliss, administered heavy doses of quinine, morphine and alcohol, which brought on bouts of vomiting that left him weak and emaciated. Bliss also conducted repeated medical probes in a futile attempt to locate the second bullet. In August, he even enlisted the help of telephone inventor Alexander Graham Bell, who used a crude metal detector called an “induction balance” to search for the slug. The machine had worked perfectly in tests, but the screening failed due to interference from metal springs on the President’s bed. To make matters worse, Bell was only permitted search the right side of Garfield’s body, where Bliss incorrectly believed the bullet was lodged.

By September, a massive infection—most likely caused by his medical treatment—had left Garfield with a persistent fever and abscesses over his entire body. He was taken to a cottage on the Jersey shore in the hope that the cool sea air would revive him, but died on the night of September 19, 1881. He had been president for just 200 days.

The nation entered a brief period of mourning for the leader it had barely known. As many as 100,000 people turned out to view Garfield’s body as it lay in state at the Capitol Rotunda, but attention soon turned toward punishing Charles Guiteau. Vigilantes tried to shoot the president’s assassin on two separate occasions, and when his murder trial began in November 1881, the court had to cycle through over 150 different men to assemble an impartial jury. Guiteau entered a plea of not guilty by reason of insanity, arguing that the assassination had been “God’s act and not mine.” He even claimed that the true cause of Garfield’s death was malpractice at the hands of his doctors. “I deny the killing, if your honor please,” he announced at one point. “We admit the shooting.”

Guiteau had a point—many historians now believe that Garfield would have lived if not for the limitations of 1880s medicine—but his insanity plea failed to convince the jury, which took less than an hour to return a guilty verdict. On June 30, 1882, nearly a year to the day after he shot the president, Guiteau was executed by hanging in Washington, D.C.

HISTORY Vault: U.S. Presidents

Stream U.S. Presidents documentaries and your favorite HISTORY series, commercial-free