Starbucks has apologized after a California sheriff's office said two of its deputies were ignored in a Riverside County store.

It is the third time in the last several months that the Seattle-based chain has been accused of mistreating law enforcement officers.

Riverside County Sheriff Chad Bianco drew attention to the incident in a Friday tweet.

"Two of our deputies were refused service at Starbucks," Bianco said in the tweet, which has been retweeted almost 2,000 times and garnered 4,000 likes as of Monday morning. "The anti police culture repeatedly displayed by Starbucks employees must end."

In a video posted to Facebook, Bianco said the deputies "were laughed at" and "obviously ignored to where other patrons knew they were being ignored" because they were in uniform. Bianco said he was very proud of how the officers handled themselves and that they went somewhere else to get coffee.

The sheriff also said that Starbucks was "doing corporate damage control" and wanted to downplay what happened.

"They're very, very adamant that Starbucks does not believe that and they do not condone that type of behavior, which is great and I don't believe they do," he said. "But don't downplay what happened and act like it was something other than what it was."

A Starbucks spokesman told NBC News by phone the deputies were ignored for nearly 5 minutes about 11 p.m. Thursday.

"We are deeply sorry and reached out to apologize directly to them," the spokesman said. "We take full responsibility for any intentional or unintentional disrespect shown to law enforcement on whom we depend every day to keep our stores and communities safe."

"No customer, in or out of uniform, should ever have that experience at a Starbucks," the spokesman also said.

Starbucks said it has launched an investigation and the employees who were on duty that evening will not be scheduled to work while it is conducted.

This episode comes about two weeks after a Starbucks barista printed the word "PIG" on the labels of an Oklahoma police officer's order on Thanksgiving in a purported joke. The barista in that incident was fired.

In July, Starbucks apologized after a barista in Arizona asked six officers to leave one of the company's stores in a Phoenix suburb because a customer reported feeling unsafe. Starbucks said the officers "should have been welcomed and treated with dignity and utmost respect" but were made to feel "unwelcome and disrespected."