(Reuters) - A federal court on Monday sided with a Michigan man who said a law that bans voters from taking pictures of their marked ballots and sharing them on social media was unconstitutional, temporarily halting enforcement of the ban on ballot ‘selfies.’

Joel Crookston last month argued that the Michigan law, which predates the social media age and was intended to prevent voter intimidation and slowing the voting process, violated his First Amendment right to free speech.

The ruling was praised by Michigan state Representative Sam Singh, who introduced legislation earlier this year to allow voters to take pictures of their ballots.

“Social media is a powerful tool and individuals who wish to proudly display their ballots, and hopefully encourage friends to vote as well, should be able to do so,” he said.

A similar battle arose in Colorado on Monday when two voters filed a federal lawsuit seeking to overturn a state law that criminalized the showing of a completed ballot to others, arguing that the ban, which could include social media postings, was unconstitutional.

Owen Hill, a Republican state senator and Scott Romano, an 18-year-old newly registered voter, said a 19th century state law that made it a misdemeanor offense for a voter to reveal the contents of a ballot was antiquated and chilled free speech.

Hill, who represents a district in the Republican stronghold of Colorado Springs, said in a statement that he is a millennial who is part of what he called “the selfie generation.”

Colorado has no law that specifically bans the sharing of selfies, but the obscure 1891 law came to light last week when Denver District Attorney Mitch Morrissey sent out a “reminder” to residents that publicly sharing a ballot is illegal.

“This would include posting your completed ballot on social media,” Morrissey said.

Citing the pending litigation, a spokeswoman for the Colorado Attorney General’s office, which is named as one of the defendants, said she could not comment on the suit.

However, Colorado Deputy Secretary of State Suzanne Staiert, whose office is also named in the suit, vowed to defend the law, saying in a statement that the law “protects voters from intimidation or inducement.”