Two New Hampshire fathers who oppose allowing transgender athletes to play high school sports will be allowed to wear pink wristbands marked “XX” to games after a federal judge ruled Thursday that school officials violated their First Amendment rights, ending more than two years of litigation.

In the dismissal order, U.S. District Court Judge Steven McAuliffe said Kyle Fellers and Anthony Foote have a First Amendment right to silently wear the wristbands. Under a settlement agreement, the Bow school district’s risk pool will pay $225,000 to the Institute for Free Speech, which represented the men in court, and $50,000 to the men’s attorney.

The plaintiffs will each receive $17.91 — an amount that symbolizes the year the states ratified the First Amendment.

Fellers and Foote sued the school district after they were banned from school grounds for wearing the wristbands, which were marked “XX” to represent female chromosomes, to a 2024 soccer game that included a transgender girl on the opposing team.

School officials argued the district had a duty to protect students from harassment from adults on school grounds. They said Foote had called himself a “real leader” who was prepared to take action, and that another parent overheard others talk about heckling the transgender athlete. Both men testified at a hearing that they did not intend to harass or otherwise target the player.

The court had previously blocked the men from wearing the wristbands while the case proceeded, but a federal appeals court later ruled in their favor, finding that school officials “cannot favor one side of a debate involving parental speech on an issue of prominent public concern.”

Fellers said he missed half of his daughter’s soccer games during her senior year because he stood up for what he believes in. “It took more than two years, but the court has recognized that what happened to us was wrong,” he said in a statement.

“Parents don’t surrender their First Amendment rights when they walk into a high school soccer game,” said Endel Kolde, an attorney for the Institute for Free Speech.

An attorney for the school district did not respond to an email seeking comment.