A Boston federal appeals court struck down a New Hampshire law banning voters from taking pictures of themselves with their completed ballots. The court said the law prevented voters from engaging in free speech and violated the First Amendment.

"The restriction affects voters who are engaged in core political speech, an area highly protected by the First Amendment," the court said in its ruling. "Ballot selfies have taken on a special communicative value: They both express support for a candidate and communicate that a voter has in fact given his or her vote to that candidate."

Major victory for ballot selfies: U.S. Court of Appeals upholds decision striking down New Hampshire's weak ban on ballot box photography pic.twitter.com/c4q7zmkvY8 — Peter Hamby (@PeterHamby) September 28, 2016

The case decision concerns changes to a New Hampshire law, which took effect September 2014, prohibiting voters from publicizing their vote and updated it to reflect the internet age. The change was sponsored by State Rep. Timothy Horrigan (D-Durham) and was “to prevent situations where a voter could be coerced into posting proof that he or she voted a particularly way.”

“The new high-tech methods of showing a ballot could be used to further a serious vote-buying scheme,” Horrigan told the Boston Globe.

Violating the law carried a penalty of fines of up to $1,000.

"The First Circuit correctly recognized that political speech is essential to a functioning democracy," American Civil Liberties Union legal director Gilles Bissonnette, who represented the plaintiffs in the case, told WMUR. "The best way to combat vote buying and voter coercion is to investigate and prosecute cases of vote buying and coercion, not ban innocent political speech."

The court ruled that the law was too broad, because it restricted the speech rights of all voters. It also said that the state hadn't shown that existing laws weren't adequate to address the problem.

Residents of the “Live Free or Die” state thought the law was another chip in their constitutional rights. A Republican lawmaker posted a selfie of his ballot which prompted a call from the state’s attorney general’s office. That led to the forming of a protest Facebook group devoted to showcasing residents’ then-illegal ballots selfies.

'Beyond upset':Americans flood hotlines with complaints about machines switching their vote https://t.co/2X31pD1Gsxpic.twitter.com/Fz90dndd4b — RT (@RT_com) March 2, 2016

The ACLU sued the state on behalf of Rideout and two other New Hampshire voters, arguing the state failed to prove its purported government interest for the law. Not since the 1890s was the state able to cite an incident of vote buying, “let alone a vote-buying transaction that was consummated by the display of a marked ballot on the internet,” the lawsuit argued.