SCARBOROUGH — A computer glitch at Hannaford Supermarkets that prevented customers from using debit and credit cards Thursday is expected to be resolved by this morning, a spokesman for the grocery chain said tonight.

The glitch began Thursday morning and affected most of the company’s 181 stores in five Northeast states.

“I want to stress that this is not in any way a security issue, it’s an operational issue,” Eric Blom, a spokesman for the grocery chain, said. “We apologize to customers for any inconvenience.”

In 2008, Hannaford had a data breach that compromised 4.2 million customers’ credit and debit card numbers.

Blom said he doesn’t know the percentage of purchases that are made with debit or credit cards, and said such information would be a trade secret.

He said signs were posted at the affected stores, alerting customers to the problem.

Dan Stapleford was entering the Hannaford store on Kennedy Memorial Drive in Waterville on Thursday when he saw a sign announcing the problem and abruptly left.

“I don’t carry cash,” said Stapleford, 42. “Checks are antiquated and slow.”

Hannaford has stores throughout Maine, Massachusetts, New Hampshire, New York and Vermont.