BARNSTABLE, Mass. (WPRI) — A court order is requiring the town of Barnstable to keep its polls open through midnight after a “mechanical issue” delayed voting on Primary Election Day.

Secretary of the Commonwealth William Galvin said Tuesday the town clerk was unable to access the vault keeping ballots, delaying their delivery to polling locations.

“Extending polling hours was necessary to make sure voters have enough time to be notified and return to their polling places if they weren’t able to vote this morning,” Galvin said.

While the mechanical issue was rectified, the town clerk printed emergency paper ballots and delivered them to polling locations, according to Galvin.

State law requires polls in Massachusetts to close at 8 p.m.