SACRAMENTO — The state Department of Motor Vehicles incorrectly registered 23,000 people to vote, including putting the wrong political party and vote-by-mail preferences for those Californians, the embattled agency said.

The DMV, which has been criticized for excessive wait times in its offices despite millions in new funding, said Wednesday that the erroneous voter registration data were sent to the California secretary of state between April 23 and Aug. 5.

It said the errors occurred when DMV technicians had more than one customer record open on a computer at the same time, causing those records to merge. Updated software and staff training will prevent the mistake from occurring again, DMV officials said.

The errors also included signing people up to vote who did not register and putting the wrong language preference. The DMV said none of the errors involved undocumented immigrants, who are eligible to sign up for driver’s licenses.

Affected customers will be sent letters noting the DMV’s error and how to correct it, the agency said.

“We are committed to getting this right and are working closely with the secretary of state’s office to correct the errors that occurred,” DMV Director Jean Shiomoto said in a statement.

The revelation brought immediate criticism from Republican lawmakers who have chided the DMV during Capitol hearings on excessive wait times. A Republican-backed proposal to investigate the DMV was killed by Democrats during a legislative audit committee hearing Aug. 8.

Officials in the department sent a status report to lawmakers Wednesday saying their wait times are down 30 minutes statewide.

The voter registration errors, which the department discovered Aug. 5, were not made public until Wednesday.

“It is one thing to wait in long lines, but quite another and even more troubling, to walk in to the DMV registered in one party to walk out registered in another,” said Assemblyman Jim Patterson, R-Fresno. “We have had similar complaints from Central Valley residents who have contacted my office. I believe this is just the tip of the iceberg. Something is being covered up that must be found, disclosed and fixed. The DMV cannot be trusted to police itself.”

Voters can check their registration status and make changes at https://voterstatus.sos.ca.gov.

Melody Gutierrez is a San Francisco Chronicle staff writer. Email: mgutierrez@sfchronicle.com. Twitter: @MelodyGutierrez