It was just a few cents here and a dollar or two there, but officials in San Mateo and Santa Clara counties say some customers at Walgreens stores statewide have likely paid extra due to discrepancies between posted prices and what is charged at the register.

District attorneys' officials say audits performed in nearly two dozen counties showed that on several occasions, the electronic price scanners used at Walgreens checkout counters registered a higher price than the lowest posted or advertised price for the item scanned.

On Wednesday, the San Mateo County District Attorney's Office announced that a settlement had been reached in a lawsuit filed against Walgreen Co. by San Mateo, Santa Clara, Santa Cruz and Santa Barbara counties. The Deerfield, Ill.-based company operates roughly 500 Walgreens stores in California.

Under the agreement, signed Wednesday by Santa Clara County Superior Court Judge Kevin McKenney, Walgreens will pay $767,000in penalties and reimbursements, and will implement policies, including an at-the-register price guarantee, to help correct the problem. The settlement was the product of months of discussion between Walgreen Co. and the plaintiffs.

It does not appear the overcharging was intentional, said Robin Wakshull, deputy district attorney for Santa Clara County.

"It was really more of a question of negligence or carelessness. ... Often it's a question of old sales tags not being removed at the end of the sale," she said.

A Walgreens spokeswoman reached Wednesday afternoon said she could not comment on the settlement but e-mailed the following statement:

"Walgreens has enhanced its pricing accuracy measures already in place and looks forward to continuing to serve its customers throughout California."

Walgreens did not admit any wrongdoing in the settlement.

The price discrepancies were discovered through routine audits performed by personnel from state and county weights-and-measures offices. One of the functions of such offices is to ensure that businesses using price scanners are charging customers correctly.

Wakshull said most discrepancies were "in the range of a penny to a dollar or two."

Walgreens is not the only business where such errors have occurred, Wakshull said.

"There's a commonality to the problem," she said. "We can understand how these problems occur, because the businesses have so many items and the prices change frequently."

As part of the settlement, Walgreens has agreed to implement a "scanner price guarantee" in which customers are entitled to a $4 discount if they are overcharged and should inform a cashier immediately. If the item in question costs less than that amount, the customer will receive it free. Otherwise, $4 will be subtracted from the item's price or the customer can opt to take home a $4 gift card instead.

Four dollars "seemed like a reasonable amount," said San Mateo County Deputy District Attorney John Wilson, who is in charge of the office's consumer and environmental unit. "There really wasn't any magic number."

Wilson said signs will be posted at Walgreens checkout counters informing patrons of the policy, which will be implemented within 45 days and will remain in effect for three years.

Walgreens is also required to begin regular, in-store price-check audits by employees and to keep records of the results.

Of the $767,000 Walgreens will pay, which does not include the $4 discounts, the Santa Clara and San Mateo district attorneys' offices will each receive $174,500 in penalties, which will go toward enforcement, Wakshull said.

Wilson urges shoppers to check their receipts, and not just at Walgreens.

"Regardless of which retailer you go to, it's always a good idea, because things can happen," he said.

E-mail Melissa McRobbie at mmcrobbie@dailynewsgroup.com.