Proposition 106 would allow medically assisted death in Colorado.

(Megan Verlee/CPR News)

A bill to allow ballot selfies in Colorado is headed to the governor's desk after the state Senate voted 31-4 Thursday to change a law making it a crime to share a completed ballot, including posting the aforementioned selfies on social media.

The law was put on hold during the 2016 election after a bipartisan group of objectors sued, saying the law inhibits political speech. U.S. District Judge Christine Arguello ruled in November that Colorado can't enforce an 1891 law preventing voters from disseminating their marked ballots.

The 1891 law was intended to prevent voter coercion. A review by The Associated Press found 18 states have laws against sharing ballot photos. Six other states bar photography in polling places but permit photos of mail-in ballots.

Courts have struck down bans in New Hampshire and Indiana, and rules have been changed in California and Rhode Island.

Colorado lawmakers had twice before rejected bills to change the law to allow "ballot selfies."

The Colorado House has already approved the bill, known as HB17-1014, so its passage through the Senate sends it to Gov. John Hickenlooper, who is expected to sign it into law.