When Sen. Bernie Sanders said this week that even "terrible people" should be allowed to vote, he summed up Vermont's longstanding law on inmate voting.

Vermont and Maine are the only states where people convicted of felonies never lose their right to vote — even while living behind bars — according to the National Conference of State Legislatures.

The rarity of Vermont's law was on display at a CNN Democratic presidential candidate town hall on Monday evening, when a Harvard University student asked Sanders whether he believed the Boston marathon bomber or people convicted of sexual assault should have voting rights in prison.

"I think the right to vote is inherent to our democracy. Yes, even for terrible people," Sanders replied.

More: Bernie Sanders says felons, even Boston Marathon bomber, should have right to vote in prison

Later in the town hall event, South Bend, Indiana, Mayor Pete Buttigieg took the opposite position and argued that the right to vote is one of the freedoms that people lose while they are incarcerated.

More:VT Insights: Bernie Sanders says focus on impeachment 'works to Trump's advantage'

How voting works in Vermont prisons

The stated policy of the Vermont Department of Corrections is to "encourage inmates to vote."

Inmates are eligible to vote if they are U.S. citizens, if they are at least 18 years old on election day, and if they are Vermont residents. They can vote in federal, state and local elections.

Vermont prisons hold voter registration drives at least 90 days before an election. Advocates from Disability Rights Vermont also offer voter registration drives.

Inmates cannot use a prison address to register to vote. Instead, they must provide their "last voluntary address."

Once they are registered, inmates can request an absentee ballot by writing to their town or city clerk and mailing back the ballot.

It's unclear how many Vermonters exercise their right to vote from prison. Inmate ballots are mixed with all other absentee ballots in the towns where they are registered.

According to a Department of Corrections internal guidance document, the right to vote also extends to the approximately 200 Vermont inmates incarcerated in Mississippi at a prison run by the private company CoreCivic.

Advocates: Voting in prison keeps inmates involved

Tina Hagen, a senior investigator at Disability Rights Vermont, said that in recent years the Department of Corrections has taken proactive steps to inform inmates about their voting rights. The process is much smoother compared to 15 years ago, she said.

"I think they feel like it keeps them part of the community," Hagen said in a telephone interview.

Ed Paquin, executive director of Disability Rights Vermont, added that it's important for people in prison to maintain connections with their families and the outside world.

"It's pretty well recognized that any connection you can keep with your community is helpful," Paquin said.

Contact April McCullum at 802-660-1863 or amccullum@freepressmedia.com. Follow her on Twitter at @April_McCullum.