Maryland Gov. Larry Hogan, right. (Jabin Botsford/The Washington Post)

The government of Maryland says it has been shortchanging thousands of workers who earn extra pay for overtime and night shifts, a mistake discovered when the state installed a new payroll and timekeeping system this year.

Budget and Management Secretary David R. Brinkley said the mistakes could affect up to 13,000 current employees — roughly one-quarter of the state’s public workforce — and an unknown number of former workers. The state could owe each of those individuals from $2 to $30 extra for each relevant pay period.

Many of the workers are police, hospital workers and corrections employees, whose jobs often require them to work nontraditional hours — between 5 p.m. and 8 a.m. Their extra pay was miscalculated by payroll workers at agencies across the government, officials said.

On Friday, state officials notified four public-employee unions — AFSCME, AFT Healthcare-Maryland, the State Law Enforcement Officers’ Labor Alliance and the Maryland Professional Employees Council — about the issue and said they plan to work with the unions to develop a process for determining the scope of the problem and how to resolve it.

“We expect every person who worked to be paid for every single hour they worked, whether it was yesterday or 20 years ago,” said Patrick Moran, president of AFSCME Maryland Council 3, the largest union representing state workers.

Union officials say they have raised concerns about payroll mistakes across state agencies for many years, only to hear that the problems were isolated. “It turns out the issues were systemic,” Moran said. “Our members were right, and the bureaucrats were wrong.”

As of Wednesday, the new computerized system was operating at all agencies except the Department of Public Safety and Correctional Services, which is expected to have it running by August. Brinkley said the errors should not occur with the new program.

But Al Wise, a 44-year-old father of five who has worked at Maryland state hospitals for 18 years and often works the night shift, said his last paycheck was about $30 short. He isn’t sure how many times he was underpaid.

“I need to take care of my household,” Wise said. “I have two girls in college. Universities don’t want to hear about why you can’t pay tuition.”

The unions had called for a faster implementation of the new system, which was begun during the administration of Gov. Martin O’Malley (D).

“The past administration said they’d change it, and it finally came to fruition this month,” Moran said.

Brinkley credited Gov. Larry Hogan (R) with speeding up the transition and insisting that the state take responsibility for the mistakes.

“The governor is in Annapolis to fix things,” Brinkley said. “The first remedy is to ensure that our employees are paid correctly, and starting with the last paycheck, that’s happening.”

Moran said the Hogan administration was just doing what it had to do.

“You can’t have something of this magnitude and hide it,” he said. “They’re very good at marketing and trying to get out in front of things.”