Not only does the U.S. president have the authority to appoint a special prosecutor—he also has the authority to fire one. President Ulysses S. Grant exercised both of these powers in 1875, during the Whiskey Ring Scandal. Before the scandal was over, Grant also did something no sitting president had done before, or has done since: He voluntarily testified as a defense witness in a criminal trial.

But let’s back up a bit.

By the early 1870s, Grant’s first term in the White House had already been tarnished by scandal. Efforts by a group of speculators (led by Grant associates James Fisk and Jay Gould) to illegally manipulate the gold market led to a financial panic in September 1869, known as Black Friday. Disillusioned with the war-hero president, a group of liberal Republicans broke away in Missouri, threatening Grant’s chances for reelection.

As Timothy Rives wrote in Prologue, the magazine of the National Archives and Records Administration (NARA), Grant sent one of his trusted allies, General John McDonald to Missouri to shore up Republican support for the president. As supervisor of the U.S. Treasury Department’s internal revenue for the St. Louis area, McDonald soon became the center of the so-called Whiskey Ring, which began as an effort to raise money for Grant and other Republican candidates.

Operating mostly in St. Louis, Chicago and Milwaukee, the ring eventually involved whiskey distillers, agents of the Internal Revenue Service, Treasury clerks and others, all of whom conspired to siphon off liquor tax revenues into campaign coffers and individual pockets. By 1873, according to Rives, the ring was no longer a political slush fund but “a purely criminal enterprise, defrauding the federal treasury of an estimated million and a half dollars a year.”

EXPLORE: Ulysses S. Grant: An Interactive Map of His Key Civil War Battles

Treasury Secretary Benjamin Bristow.

Things began to unravel in June 1874, when Grant appointed Benjamin H. Bristow to replace William Richardson (who had resigned due to a different scandal) as treasury secretary. When Bristow learned of the Whiskey Ring’s existence, he made breaking the scheme up his personal mission. With the help of undercover investigators and informants in various cities across the country, Bristow secretly assembled a case against the Whiskey Ring, before arresting more than 300 suspected ring members in May 1875.

READ MORE: 10 Things You May Not Know About Ulysses S. Grant

The following month, Grant appointed John B. Henderson as a special prosecutor in the investigation, hoping to head off criticism about any conflict of interest. Henderson, a former U.S. senator from Missouri, worked together with U.S. attorneys to start handing down indictments in the St. Louis ring, including General McDonald.

John B. Henderson, the first special prosecutor in the Whiskey Ring scandal.

The trail of evidence led straight into Grant’s inner circle, implicating his personal secretary and longtime friend, General Orville Babcock. McDonald allegedly sent Babcock expensive gifts to dissuade the White House from inquiring into the scheme, and U.S. attorneys found telegrams between Babcock and McDonald that appeared to be written in code. Informed of Babcock’s potential involvement, Grant initially accepted the investigation’s findings, saying “Let no guilty man escape if it can be avoided.”

But Babcock soon managed to convince the president that he was innocent, arguing that the Whiskey Ring prosecutors were politically motivated, and that Bristow in particular was just trying to bolster his own chances to win the Republican presidential nomination. By December 1875, when the government indicted Babcock, Grant had grown hostile to the investigation. (McDonald and others had already been convicted in St. Louis, receiving prison sentences and thousands of dollars in fines.)

Then, in his closing argument at the trial of another accused ring member, Henderson accused Babcock of obstructing justice and hinted that his involvement raised questions about Grant’s own role in the scandal. That was too much for Grant, who fired Henderson as special prosecutor and replaced him with James Broadhead.

A political cartoon on the Whiskey Ring scandal by artist Thomas Nast. (Credit: Bettmann/Getty Images)

Soon after Babcock’s trial began in St. Louis in early February 1876, Grant assembled his cabinet and informed him that he would testify on his friend’s behalf. At the urging of Secretary of State Hamilton Fish and others, Grant didn’t travel to St. Louis—which would have been an uncomfortably public spectacle—but gave a sworn deposition in the White House, in which he attested to Babcock’s innocence.

READ MORE: The Biggest Political Scandals in American History

Thanks in large part to Grant’s testimony, the court later found Babcock innocent, and he became the only major defendant in the Whiskey Ring Scandal to win acquittal. Babcock’s attempt to resume his duties in the White House met with a public outcry, however, and he was forced to resign. Just 10 days later, he was indicted for his alleged role in another administration scandal, the so-called Safe Burglary Conspiracy.

General Orville Babcock

Of the 238 individuals indicted in the Whiskey Ring case, 110 would be convicted, and more than $3 million of the stolen tax revenues recovered. An outcast in the Grant cabinet, Bristow resigned as treasury secretary in June 1876. He did indeed seek the Republican presidential nod, but lost out to Rutherford B. Hayes, governor of Ohio.

Though Grant himself never betrayed his reputation for honesty, his legacy as president was marred by the corruption of his associates, appointees and trusted friends—as the saga of the Whiskey Ring Scandal clearly demonstrates. Grant left office in 1877, after eight scandal-plagued years, and embarked with his family on a two-year trip around the world. Though his supporters later made a bid to make Grant the 1880 Republican nominee, he lost out to James Garfield. In 1884, Grant was diagnosed with throat cancer; after his death the following year, his memoirs became a major financial and critical success.