The New Jersey attorney general’s office will investigate how votes were counted twice in some Monmouth County elections in November, potentially flipping the results of one race.

The state Division of Civil Rights — which falls under the attorney general’s office — said it had hired the firm Patterson, Belknap, Webb and Tyler LLP on a pro bono basis to investigate whether anything unlawful happened during the election. The firm will also make recommendations for future election reform, the attorney general’s office said Wednesday.

Former New Jersey Attorney General Peter C. Harvey, who served in the role from 2003 to 2006, will oversee the probe.

Election Systems and Software — which produces voting systems used broadly nationwide, including in about a third of New Jersey counties — told Gothamist last week that human error was to blame for the problem, which affected results in six voting districts spread across four municipalities.

County officials said Wednesday they welcomed and supported the inquiry, in a statement provided by spokesperson Karla Roth-Bardinas.

Only one race was close enough for its outcome to potentially change: Steve Clayton’s 20-vote victory over Jeffrey Weinstein for the Ocean Township school board. Clayton took office earlier this month. Other races in Belmar, Fair Haven and Tinton Falls also showed discrepancies in their tallies.

ES&S said in a statement last week a USB drive with results was “loaded twice into the results reporting module.” The company said safeguards in its software would still normally prevent votes from being counted twice, but a technician reinstalling software over the summer skipped a step and that feature wasn’t working.

In a statement issued on Wednesday, Attorney General Matt Platkin said the investigation was needed “to encourage and preserve public trust in our elections.”

The problem was first reported last week by the New Jersey Globe political news blog run by David Wildstein, a longtime Republican politician and confessed mastermind of the Bridgegate scandal during Gov. Chris Christie's administration. In a separate report, The Globe also said former Belmar Councilman James Bean filed a public records request in November after noticing inconsistencies in election results. Bean told the blog he reached out for weeks to election officials, but didn’t hear back from the county’s superintendent of elections until December.

On Nov. 28, board Chief Clerk Tracee Johnson wrote to state officials saying a post-election audit hadn't found any issues aside from stray marks on some ballots and a paper jam that kept one ballot from dropping into a voting machine sleeve.

ES&S said the issue was found after a review made at the county’s request, but it didn’t say why the county made the request. County officials and the state attorney general’s office have asked a judge to allow an emergency recount and recertification of the vote. The attorney general’s office said the court will hear arguments but not testimony on Feb. 1.

The office hasn’t yet answered a message asking what guidance it had given Monmouth County election officials, or those in other counties that use the same systems. Sharon Lauchaire, a spokesperson for the office, has also previously declined to comment on when the office first became aware of the situation, and whether it’s satisfied the issue didn’t extend beyond the districts already identified.

Roth-Bardinas, the county spokesperson, didn't answer questions sent by email Wednesday asking when election officials became aware of the issue, or why the note to the state about the audit didn't address them.

Last week, Monmouth County election officials urged the state to require annual recertification of election systems, and to create a mandatory checklist for ensuring systems work properly.

“The only current tests provided by the state would not catch the step missed and acknowledged by ES&S, which allowed votes to be counted twice,” they wrote in a statement at the time.

The headline on this story has been updated. This story has additionally been updated to include further statements from a spokesperson for Monmouth County.