AVERILL PARK — They're engaged to be married, but Keith Hammond and Brenda Mahar are running against each other for state Assembly.

Hammond, a Democrat who served over a decade in the Rensselaer County Legislature, explained that Mahar's candidacy was really just a bid to let voters write him in for the Working Families Party line. It's less "War of the Roses" than a Dickensian trip through New York's complex election laws.

"This is not the kind of thing we encourage candidates to do," said Rensselaer County Democratic Chairman Tom Wade.

Hammond and Cheryl Roberts, an attorney who works for the City of Hudson, both sought the endorsements of the Democrat and Working Families parties to represent the 107th District. The seat covers parts of Rensselaer, Columbia and Washington counties and is currently held by Assemblyman Steve McLaughlin, R-Schaghticoke.

Democrats often seek the Working Families Party line as an electoral boost, and in primary contests it helps them argue they are more likely to win a general election. Both Hammond and Roberts interviewed with separate groups of Working Families Party officials in Rensselaer County, according to Karen Scharff, the party's Capital Region-based co-chairwoman. Each group recommended their interviewee, and since the seat crosses county lines, the ultimate decision fell to the state committee. Hammond said Roberts entered the race late, and the process was reopened to accommodate her.

Since neither candidate is an enrolled WFP member, they need a special blessing from party leaders to appear on its line. According to Scharff, the state committee heard the Capital Region executive committee's recommendation and picked Roberts.

Hammond, a former dairy farmer who has raised several foster children, said he felt "disenfranchised" and "infuriated" by WFP higher-ups.

"The only reason I wasn't chosen was because I wasn't as well-connected and don't have the kind of money my opponent claims to have," he said. "Can't we just have people vote for who they want? Wouldn't that be the fair way?"

He could have circulated special petitions allowing him an "opportunity to ballot," which would have prompted a primary for the WFP line with only Roberts' name on the ballot; Hammond's supporters within the party would then have the opportunity to write in his name.

But he said "it was just as easy" to circulate petitions to nominate Mahar, who is an enrolled WFP member. Now that there's a primary on Sept. 13, anyone — including Hammond — can be written in.

It's circuitous, but it's legal. And in a low-turnout primary, it's tough to separate a screen pass from a Hail Mary.

Scharff said the situation was "unfortunate."

"The WFP made its decision on which candidate we want to have on our line, and I think it's unfortunate there's another candidate who wants to contest that, but that's the primary process," she said.

In a statement, Roberts' campaign manager Joe Brill said she is "committed to running an aboveboard and transparent campaign and, with the utmost respect for the Democratic process, has no interest in playing games."