By Scott Malone

BOSTON (Reuters) - A 2014 New Hampshire law prohibiting voters from taking selfies with their ballots on election day is an unconstitutional infringement on the right to free speech, a federal appeals court ruled on Wednesday.

The New England state had banned the practice, which has become a popular way for voters to show support for favored candidates, claiming that it would set the stage for a return of the vote-buying scandals that rocked many U.S. states in the 19th century.

Three New Hampshire citizens, including a man who wrote in the name of his dog to express dismay at his choices in the 2014 Republican primary for the U.S. Senate, sued the state that year claiming the measure violated their rights to free expression, as protected by the First Amendment of the U.S. Constitution.

A federal court in New Hampshire sided with them, but the state appealed, making its case in Boston just two weeks ago. The appeals court swiftly rejected its arguments.

"The statute's purposes cannot justify the restrictions it imposes on speech," Circuit Judge Sandra Lynch wrote in the court's decision.

New Hampshire's argument that ballot selfies could lead to people selling their votes or being compelled by their employers to vote in a certain way fell short in no small part because the state had no evidence of that actually happening, Lynch wrote.

"The legislative history of the bill does not contain any corroborated evidence of vote buying or voter coercion in New Hampshire during the 20th and 21st centuries," she wrote. "Digital photography, the internet, and social media are not unknown quantities -- they have been ubiquitous for several election cycles, without being shown to have the effect of furthering vote buying or voter intimidation."

Lynch also noted that several federal and state laws in effect in New Hampshire already make it illegal to buy or sell a vote, which would allow prosecutors to take on allegations of election tampering even in an environment where selfies were permitted.

Other states, including nearby Rhode Island, have passed laws explicitly allowing ballot selfies, partly reasoning that the trend has helped younger voters show their enthusiasm for the democratic process.

(Reporting by Scott Malone; Editing by Tom Brown)