When President Donald Trump announced on Friday that he is pardoning former Maricopa County Sheriff Joe Arpaio, who was convicted on July 31 of contempt of court for continuing use immigration-enforcement tactics that had been found by a judge to be discriminatory, he was taking part in a presidential prerogative that dates back to the earliest days of the United States.

But, especially considering reports that the Department of Justice was not fully in the loop about Trump’s decision, the announcement represents a departure from the pardon process of the past few decades, in which pardons have followed petitions to the DOJ’s Office of the Pardon Attorney. In addition, particularly for more controversial cases, they have tended to come later in presidents’ terms.

It remains to be seen how President Trump will use his power to pardon for the rest of his term. But, as the history of that power makes clear, there’s one right way to do so, especially in high-profile cases: very carefully.

The idea of a leader forgiving the crimes of citizens has deep roots. It can be traced back to what’s believed to be the oldest known legal code, the Babylonians’ Code of Hammurabi, and to ancient Athens, where those who sought pardons had to collect 6,000 signatures. In medieval England, kings doled out pardons to raise money and armies, as pardonees back then often offered cash or military service in exchange, as Michigan State law professor Brian C. Kalt has detailed in The Yale Law Journal. The tradition of the pardon power endured throughout the centuries — in part for the reason summed up by Alexander Hamilton when he wrote that “without an easy access to exceptions in favor of unfortunate guilt, justice would wear a countenance too sanguinary and cruel.”

Article II, Section 2 of the U.S. Constitution gives the Commander-in-Chief power to “grant Reprieves and Pardons for Offenses against the United States,” though that only applies to federal crimes, not civil ones or state-level crimes, for which governors can issue pardons. The Constitution also prohibits presidential pardons in “cases of impeachment.” (The reason, many believe, can be traced back to a 17th-century case in which Britain’s Parliament started impeachment proceedings to investigate whether the Earl of Danby had taken a bribe from the French; King Charles II, who it turned out was in fact the one behind the bribes, pardoned him in order to prevent the truth from coming out.)

Given such latitude, U.S. presidents have found that the reasons to use the power are many. Beyond the most obvious case — restoring innocence in the case of a miscarriage of justice — presidents have issued pardons to check other branches of government, to maintain public order or to secure a legacy. And, accordingly, those many reasons have led to many uses. P.S. Ruckman, Jr., political scientist and editor of the blog Pardon Power, counts just over 30,000 individual acts of presidential clemency from Presidents Washington to Obama.

“For most of American history,” he says, “presidents pardoned frequently, early, and often.”

But, for a variety of reasons, the nature of the presidential pardon has changed.

The Popular Pardon

The first major clemency decision in U.S. history happened to set an example of how pardons could be used to keep the public happy and help the country move forward from times of trouble. It came after the late 18th century Whiskey Rebellion, in which a tax on American-distilled whiskey led to armed revolt. After calling in state militias for reinforcements, President George Washington, via Virginia Governor General Henry Lee, pardoned the “Whiskey Rebels,” thus smoothing over the matter and establishing a record of mercy.

Washington’s decision was to have many future parallels. Abraham Lincoln pardoned soldiers who ran away during the Civil War — those who fought for the Union and agreed to return to the battlefields after their pardons as well as erstwhile supporters of the Confederacy, in an effort to cripple the rebellion — while Andrew Johnson’s pardon of Confederate soldiers who pledged allegiance to the Union has been seen as a way to bring the North and South together after the Civil War. Jimmy Carter did the same for draft dodgers after the Vietnam War. And on Christmas Eve 1921, fears of civil unrest are thought to have motivated President Warren Harding to commute the 10-year prison sentence of five-time Socialist presidential candidate Eugene Debs, who had been jailed for making a speech criticizing the U.S. government’s entry into World War I. (A presidential pardon restores some rights that are often revoked for those with criminal convictions, and nowadays generally happens after a person has already served a sentence and lived free for a while. A commutation is a reduction in punishment)

That sentiment can also expend to tranquility between countries. President Harry Truman commuted the death sentences of Puerto Rican nationalists who tried to assassinate him right before a new Puerto Rican Constitution went into effect on July 24, 1952. The decision seemed to be an attempt to keep things nice with the U.S. territory, argues Jeffrey Crouch, a political scientist at American University and author of The Presidential Pardon Power.

Get our History Newsletter. Put today's news in context and see highlights from the archives. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

When a President Needs a Pardon

Perhaps the most famous and most controversial presidential pardon of a single person took place in 1974. After President Richard Nixon was forced to resign after Watergate, his successor in the office, Gerald Ford, declared on Sept. 8, 1974, that Nixon had “suffered enough” and would be pardoned. “My conscience tells me that only I, as President, have the … power to firmly shut and seal this book,” he told the American people. “My conscience says it is my duty not merely to proclaim domestic tranquillity, but to use every means I have to ensure it.” And with Richard Nixon on trial, he said, the “tranquility” of the nation could be “irreparably lost” amid such “prolonged” and “divisive debate.”

But, while Ford was ready to pardon Nixon, Americans were not.

Historian Arthur Schlesinger Jr. told TIME in the wake of the decision that it represented a “double standard of justice,” and suggested that “the President is indeed above the law.” A September 1974 Gallup poll reported 53% thought it was the wrong thing to do, while 38% said it was the right thing. The pardon is thought to be one reason why Ford lost the 1976 election to Jimmy Carter.

“The political fallout was far more serious than I contemplated,” Ford told CBS News correspondent Phil Jones in 1984. “I knew it would have a downside politically, but I had to weigh the political ramification, which was obviously negative, with the benefit to the country, which was very significantly on the upside. And that’s part of your job in the White House.”

The Reluctance to Pardon

In the last 30 years, Presidents have been somewhat more reluctant to use the power in high-profile cases — and not just because of what happened to Ford.

For one thing, a clash between presidential hopefuls on the 1988 campaign trail ended up contributing to the fear of clemency among politicians in general, Ruckman argues. Michael Dukakis had supported a program that furloughed prisoners for a weekend, and one of them, convicted murderer Willie Horton, broke into a couple’s home, stabbing the husband and raping the wife. Bush supporters ran a famous ad that dealt a powerful blow against Dukakis and made such mercy seem dangerous. “Everyone’s afraid of the next Willie Horton,” as Ruckman puts it. The era of 24/7 cable news and social media only makes that fear more acute.

And the presidential pardons that have been issued in recent decades — at least the ones that have made headlines — have tended to get a fairly negative reaction, portrayed as self- or party-serving.

George H.W. Bush’s Christmas Eve 1992 pardon of six people involved in the Iran-Contra Affair was portrayed as a “cover-up” designed so that Bush wouldn’t have to testify in a trial on the matter. In 1999, Bill Clinton’s offer to commute the sentences of members of FALN, a Puerto Rican paramilitary organization, was seen as a way to shore up Hispanic support for then-First Lady Hillary Clinton’s future run for a New York U.S. Senate seat. Clinton was also criticized for pardoning “fugitive tycoon” Marc Rich, whose ex-wife was thought to be one of the Clinton Presidential Library’s biggest donors. In 2007, George W. Bush was accused of showing favoritism to an administration official by commuting a sentence for Vice President Dick Cheney’s former chief of staff, Scooter Libby. (Cheney reportedly wanted more, however, and was “angry” that Bush didn’t pardon Libby.)

But, while the presidential pardons mentioned so far made national news, they are the exceptions. Because presidents sign hundreds at once, “most clemency decisions go almost unnoticed,” says Crouch. “Clemency has usually been — in recent years, at least — given to fairly anonymous people for older, non-violent crimes.”

Take President Obama’s record on this issue. He issued 212 pardons and 1,715 commutations, granting 330 on his last day in office alone. With notable exceptions like Wikileaks tipster Chelsea Manning, most of the people who benefited from his clemency power were nonviolent drug offenders locked up for crimes for which sentencing guidelines have changed and that disproportionately affected minorities. However, compared to other past presidents, he boasts one of the lowest rates of granting clemency, having agreed to just 5% of all clemency petitions received. (Approximately 40% each were granted by Presidents William Howard Taft, Woodrow Wilson and Harry S. Truman.)

One irony of the history of presidential pardons is that chief executives got less generous about granting clemency just as sentences for many crimes got longer. When presidents were giving out more pardons, in the late 19th century and early 20th century, the federal prison system was just starting to take shape and sentences weren’t as long.

One big reason for that is that even if the president isn’t afraid to issue a pardon or commute a sentence, there’s some bureaucratic red tape that has made it harder for these requests to get to his desk in the first place. Margaret Colgate Love has written about how the process became guided by career prosecutors, many of whom view clemency petitions as challenges to law enforcement policies. If that recent history is any indication, pardons may not be a top priority in the coming years, given Attorney General Jeff Sessions‘ background as a prosecutor.

But, as she tells TIME, the true power of the pardon remains: “There’s always that wonderful function of being able to tell good news.”

Correction, Feb. 14

The original version of this story misstated what a presidential pardon does. It restores some rights that are often revoked for those with criminal convictions, but it does not wipe their criminal record clean. It also misstated what Eugene Debs’s speech was protesting. It opposed U.S. entry into World War I, not World War II.

Write to Olivia B. Waxman at olivia.waxman@time.com.