In the US, government officials have executed innocent people in the past. At Sunday's Democratic town hall, an exonerated former death row inmate who barely escaped this fate, Ricky Jackson, challenged Hillary Clinton on her support for the death penalty given cases like his.

"In light of what I just shared with you and in light of the fact that there are documented cases of innocent people who have been executed in our country," Jackson said, "I would like to know how you can still take your stance on the death penalty in light of what you know right now."

Clinton responded with caution, but reiterated her support for the death penalty in limited cases at the federal level:

This is such a profoundly difficult question. And what I have said and what I continue to believe is that the states have proven themselves incapable of carrying out fair trials that give any defendant all the rights that defendants should have [and] all the support that the defendants' lawyers should have. And I've said I would breathe a sigh of relief if either the Supreme Court or the states themselves began to eliminate the death penalty. Where I end up is this, and maybe it's a distinction that is hard to support. But at this point, given the challenges we face from terrorist activities, primarily in our country, that end up under federal jurisdiction, for very limited purposes I think it can still be held in reserve for those. And the kind of crimes I'm thinking of are the bombing in Oklahoma City — where an American terrorist blew up the government building, killing as I recall 158 Americans, including a number of children who were in the preschool program — [and] the plotters and the people who carried out the attacks on 9/11. But a very limited use of it in cases where there has been horrific mass killings. That's really the exception that I still am struggling with and that would only be in the federal system. But what happened to you was a travesty. And I just can't even imagine what you went through and how terrible those days and nights must have been for all those years. And I know that all of us are so regretful that you or any person has to go through what you did. And I hope that now that you are standing here before us that you will have whatever path in life you choose going forward and that you will get the support you deserve.

Clinton's stance is essentially what she said at a previous debate: She believes the federal government should be able to use the death penalty in rare cases but that states have shown themselves incapable of maintaining capital punishment. (States especially have come under increasing scrutiny in the past few years over their inability to obtain proven, safe lethal injection drugs.)

At least 4 percent of people sentenced to death are likely innocent, according to a 2014 study published in PNAS, a scientific journal.

Clinton's stance — that the death penalty should be allowed even if it's sometimes been used on innocent people — is not uncommon among supporters of the death penalty. A 2015 Pew Research Center survey found that about 63 percent of people who favor the death penalty agree there's some risk of putting innocent people to death.

But support for the death penalty has been generally shrinking for the past few years, particularly among Democrats. The Pew survey found that while support for the death penalty has dropped among all Americans, the sharpest decline has happened among Democrats — and 56 percent of Democrats oppose the death penalty.

So Clinton's continued support for capital punishment may actually put her out of line with most of her party. Bernie Sanders, meanwhile, has opposed the death penalty for decades.

Watch: Hillary Clinton on the death penalty