SCARBOROUGH — A computer glitch at Hannaford stores prevented customers from using debit and credit cards at checkout counters in most of its 181 stores in five Northeast states Thursday.

The glitch began Thursday morning and the problem was unresolved by press time. Eric Blom, a spokesman for the grocery chain, said the company is working with its software vendor to correct the problem.

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

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

Blom wouldn’t disclose the name of Hannaford’s software vendor.

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

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

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

At the Hannaford on Whitten Road in Augusta, some registers were able to process debit cards as credit cards, but some would not accept either, an employee said.

There are more than 181 Hannaford stores throughout Maine, Massachusetts, New Hampshire, New York and Vermont.