President Donald Trump's call this week for the suspected New York truck attacker to be given the death penalty fit a long-standing pattern. Trump has been a staunch supporter of capital punishment for decades, calling for death sentences to be handed down time and time again.

Trump has issued public pleas for the death penalty after mass shootings, military desertions and, in one controversial case, a brutal attack on a jogger in Central Park, after which police arrested five teenagers who were later exonerated.

But while Trump's stance has been unwavering, public opinion has gradually shifted as the American public has increasingly turned against the death penalty amid an overall decline in its use nationwide.

Polls have shown that while most Americans back capital punishment, that level of support has been declining. Most recently, a Gallup poll conducted last month found that 55 percent of Americans favored the death penalty, the lowest level of support in nearly half a century and down significantly from a peak two decades earlier.

Trump's stance on the death penalty fits with his pattern of calls for quick, harsh punishment, one that predated his ascension to the Oval Office. In perhaps the most high-profile example, Trump, then a celebrity real estate developer, took out full-page advertisements in 1989 to call for a return to the death penalty after a female jogger was beaten and raped in Central Park.

Five black and Hispanic teenagers were arrested and convicted in the case, spending years in prison. The group, known as the "Central Park Five," were later exonerated and agreed to a $40 million settlement with New York City. Late in the presidential campaign last year, Trump suggested that he still believed they were guilty, calling it "outrageous" that the case was settled.

Trump has weighed in over the years on a number of other cases, and both before and after assuming the presidency, he used Twitter to make his feelings known.

In 2012, after a gunman opened fire inside an Aurora, Colo., movie theater, killing 12 people and injuring scores more, Trump wrote:

"At least 12 dead and 50 wounded in Colorado-bring back fast trials & death penalty for mass murderers & terrorists.

- Donald J. Trump (@realDonaldTrump) July 20, 2012"

"Fast trial and death penalty for maniac in Colorado- immediately pass speed up legislation.

- Donald J. Trump (@realDonaldTrump) July 23, 2012"

In both cases, Trump's calls went unanswered. The lengthy trial ended with the jury giving the gunman a sentence of life in prison without parole, sparing him a death sentence.

Trump also called for "fast trials and death penalty for the animals" after a shooting at the Empire State Building that same year. (The gunman was killed by police officers.) He also urged a change in the law so Drew Peterson, a former Illinois police officer convicted of killing his wife, could receive the death penalty. (Illinois had abolished its death penalty in 2011.)

After the Boston Marathon bombing in 2013, Trump quickly called for the death penalty. He went on Fox News to issue one such plea, and posted another on Twitter:

"Get ALL the info, then quick trial, then death penalty for the Boston killer of innocent children and people! Do not be kind.

- Donald J. Trump (@realDonaldTrump) April 19, 2013"

Trump's wishes were partially granted in that case. The Obama administration won a death sentence for the surviving Boston Marathon bomber, although it was not a quick trial. Opening statements began in March 2015, nearly two years after the attack, and the bomber was sentenced two months later. (It remains unclear when the federal government will actually be able to execute him.)

After a beheading in Oklahoma in 2014, Trump used now-familiar language, calling the attacker an "animal" and urging "a very fast trial and then the death penalty." In that case, he even suggested a method of execution:

"The animal who beheaded the woman in Oklahoma should be given a very fast trial and then the death penalty. The same fate - beheading?

- Donald J. Trump (@realDonaldTrump) September 27, 2014"

The jury recommended a death sentence in the case last month, though a judge will formally decide the sentence.

In 2015, the same year Trump entered the presidential campaign, he weighed in on a case that he would also mention in other venues:

"Sgt. Bowe Bergdahl should face the death penalty for desertion - five brave soldiers died trying to bring him back. U.S. has to get tough!

- Donald J. Trump (@realDonaldTrump) March 26, 2015"

Trump's rhetoric regarding Bergdahl's case, which included describing him as a "dirty, rotten traitor," has loomed over his court-martial. The judge has said he would consider those remarks as mitigating evidence that could lessen Bergdahl's possible punishment.

After two Mississippi police officers were killed in 2015, Trump commented on the case by referencing protests against shootings by police officers and using familiar language:

"How come there are no protests in favor of the two young police officers gunned down in Mississippi by two deranged animals. DEATH PENALTY!

- Donald J. Trump (@realDonaldTrump) May 11, 2015"

Trump also said during the campaign he would issue an executive order mandating the death penalty for anyone who kills a police officer, though no such order has been signed. (In federal cases and many states, killing a law enforcement officer is already an aggravating factor that can warrant a death sentence.)

This week, Trump again used Twitter to call for the death penalty in a case, albeit with different circumstances than when he did so previously. When Trump called for a death penalty after the Boston Marathon, he was a reality television star comment on Twitter; when he calls for it now, he is a commander in chief making public statements.

"NYC terrorist was happy as he asked to hang ISIS flag in his hospital room. He killed 8 people, badly injured 12. SHOULD GET DEATH PENALTY!

- Donald J. Trump (@realDonaldTrump) November 2, 2017"

". . .There is also something appropriate about keeping him in the home of the horrible crime he committed. Should move fast. DEATH PENALTY!

- Donald J. Trump (@realDonaldTrump) November 2, 2017"

Trump also called the suspected attacker "an animal" during remarks this week. But his tweets, posted late Wednesday and early Thursday, coming just hours after federal prosecutors filed charges in the case, could pose a potential issue going forward.

One of the charges in the New York case could carry with it a death sentence, although prosecutors have not said whether they will seek that. If that happens, defense attorneys could point to Trump's tweets and argue that they impact whether the suspect can receive a fair trial.

Trump's latest remarks came as the death penalty has faded in both popularity and usage in the United States.

Capital punishment had much more support as recently as two decades ago. In the mid-1990s, about four out of five Americans said they favored capital punishment, a number that has fallen since, reaching the 55 percent mark reported by Gallup last month.

According to Gallup, the last time public support for the death penalty was below 60 percent was in 1972, when Richard M. Nixon was in the White House.

Even as public support has fallen overall, it has not declined equally among all groups, as sharp divides remain among partisan and demographic groups. Gallup's latest poll showed that Democrats, a majority of whom had supported the death penalty as recently as 2012, have turned against it, with support dropping to 39 percent this year from 51 percent five years earlier. Republican support remains strong, with seven in ten backing it in the most recent poll, though that is down from 82 percent last year.

A Pew Research Survey last year that saw overall support dip below 50 percent for the first time since 1971 found that 57 percent of white people backed the practice, significantly higher than the support found among black people (29 percent) and Hispanic people (36 percent).

When the death penalty had stronger overall support two decades ago, the violent crime and murder rates across the United States were much higher than they are today, although they had already begun a steady decline that began in the early 1990s.

Crime has been a repeated focal point for the Trump administration, a point highlighted by Trump's vow to end "American carnage" in his inaugural address. Attorney General Jeff Sessions has expressed concerns that recent increases in violent crime, while far below the levels seen a quarter-century earlier, marked "the beginning of a trend." (The American people, for what it's worth, always tend to believe crime is up, even when it is not.)

As violent crime was declining during the 1990s and support for the death penalty was surging, something else was happening: States were carrying out more and more executions. In 1999, there were 98 executions nationwide, a modern peak that saw an average of nearly two death sentences carried out per week.

That number soon began to fall, last year dropping to 20 executions total, the lowest number nationwide since 1991. Fewer states have the death penalty, and among those that do, many have struggled to obtain lethal injection drugs or faced legal or logistical hurdles. The number of death sentences has also dropped, falling to 30 last year, the fewest since 1972, according to a report from the Death Penalty Information Center.

All told, the United States is a country where capital punishment is declining but not disappearing. There have been 21 executions this year, exceeding last year's total, part of an increase that was expected as states such as Arkansas, Florida and Ohio resumed executions after hiatuses. Several executions are scheduled through the end of the year, though legal challenges could delay some.

The federal government has taken a little more than 200 death penalty cases to trial since 1988, according to the Federal Death Penalty Resource Counsel Project, and those that went before juries ended with life sentences about twice as often as death sentences.

There are 61 people on federal death row, accounting for a fraction of the more than 2,800 death row inmates nationwide, according to the Death Penalty Information Center. Federal executions are a rarity. Since the federal death penalty statute was reinstated in 1988 and expanded in 1994, three inmates have been put to death by the government, all of them by lethal injection. The last such execution was in 2003.