Mary Glassman has held on to her Democratic party endorsement by two votes in the 5th U.S. House District race after a review of last-minute vote switching by the party’s statewide office.

A review by the Democratic State Central Committee, released late Tuesday, showed that two vote switches, which swung the lead at the May 14 convention from educator Jahana Hayes to Glassman, were improperly recorded and thus voided.

But that small victory was not enough to push Hayes past Glassman, who wins the endorsement. The new final delegate vote total under the ruling is 171 votes for Glassman and 169 for Hayes.

Both sides on Thursday accepted the ruling by a 5-person panel, which convened and held a June 7 hearing after three complaints from Waterbury Democrats.

“The dispute resolution committee's ruling affirms what we have said since the convention, Mary Glassman won the convention despite a lot of political obstacles in front of her and she is focused on winning the primary in August,” said Mark Bergman, a spokesman for the former 8-term Simsbury first selectman.

Hayes, the 2016 national teacher of the year, said even though the ruling did not change the convention outcome, she was pleased the citizens had the opportunity for redress and the integrity of the voting process was re-established.

“It is my hope that this decision shows those in attendance at the convention that they are a crucial part of the process and their voices matter,” said Hayes, who was encouraged to run for office by U.S. Sen. Chris Murphy.

Glassman and Hayes will face off in an Aug. 14 primary. Longtime U.S. Senate employee Shannon Kula said Wednesday she submitted enough signatures to petition her way onto the primary ballot, joining Glassman and Hayes.

Among those lodging complaints in the vote-switching was Waterbury Mayor Neil O’Leary, who disputed the endorsement, questioning whether voting “irregularities,” “suppression” or “manipulation” occurred.

Both Hayes and Glassman declared their plans to run for Congress after three-term Democrat Rep. Elizabeth Esty, dropped her re-election bid after news broke that she covered up an office abuse scandal.

The five-member review panel found that two of three vote switches by the New Britain delegation from Hayes to Glassman were announced, but improperly recorded on convention balloting forms. The panel called this a “fatal error” and thus decided to reinstate those votes to Hayes.

The panel also noted two other problems at the convention: the first ballot roll call said more votes had been cast than the number of delegates voting and the counting of the second ballot took an inordinate amount of time due to issues with vote intake and review. While these issues caused delays, they were rectified at the convention, the panel noted; but they were contributing factors to the dissatisfaction of the complainants with the convention process.

In its ruling, the panel recommended Democrats review the entire convention process.

“These discussions will take place at Democratic State Central Committee meetings and at Rules Committees for future conventions,” said Christina Polizzi, spokeswoman for the state Democratic party.; Twitter: @emiliemunson