PHOENIX — A poll worker who was on duty during Arizona’s problematic presidential primary testified Monday that 36 Democratic voters were given incorrect ballots by an electronic machine and 20 other Democrats were listed in the wrong party.

The testimony by Dianne Post was heard during a hearing in a courtroom packed with voters and election officials, including Maricopa County Recorder Helen Purcell, the top election official in the county.

A voter testified that she was incorrectly identified on Pima County’s voter rolls as an independent when she’s a Democrat.

The hearing before Maricopa County Superior Court Judge David Gass was convened after he rejected requests to dismiss the lawsuit.

Tucson resident John Brakey sued Arizona Secretary of State Michele Reagan and all 15 counties after the election. He contends long lines in Maricopa County suppressed the vote and statewide voter registration problems led to illegal vote counts. He wants the results of the March 22 primary decertified.

The attorney general says the primary results can’t be challenged.

Post, an attorney, testified that a machine she was using to check in voters at a Maricopa County location failed to give 36 people the proper ballot.

“Every single time it happened to me it was a Democratic voter who wasn’t able to access a Democratic ballot,” she said.

Another 22 people at her location were listed in the wrong party, she said. Her polling place also ran out of ballots for at least two congressional districts.

Alisa Wolfe, a resident of Pima County, testified that her voter registration was improperly changed from Democrat to independent.

Wolfe said she was able to vote provisionally after speaking to the Pima County Recorder’s Office and being told the problem was a computer glitch.

Before testimony began, Assistant Attorney General James Driscoll-MacEachron attempted to have the legal action dismissed. Among other things, he claimed the primary doesn’t fall within the scope of what electors can challenge.

A separate lawsuit was filed last week in federal court by the state and national Democratic parties and presidential candidates Hillary Clinton and Bernie Sanders. It seeks greater court oversight of voting location choices in Maricopa County and a ban on failing to count otherwise-valid ballots cast in an incorrect precinct.

The county has acknowledged it made mistakes in operating the primary by dramatically cutting the number of polling places and widely underestimating Election Day turnout.

The U.S. Department of Justice has launched an inquiry into whether the county violated voting-rights laws.

SUBSCRIBE: Get the analysis of Mark Shields and David Brooks delivered to your inbox every week.