The apology comes more than a year after Starbucks temporarily closed 8,000-plus U.S. stores.

Starbucks has apologized to police in Arizona after six officers said they were asked to leave one of the coffee chain's stores last week because another customer said the officers made them feel unsafe.

The incident was brought to light by the Tempe Officers Association, and soon the hashtag #DumpStarbucks started trending on Twitter. But even as some people online voiced concerns about the perceived hostility to law enforcement, others said the encounter highlighted distrust of police in a city where an officer's fatal shooting of a 14-year-old boy earlier this year has sparked criticism of police's use of force.

The apology comes more than a year after Starbucks temporarily closed 8,000-plus U.S. stores for what it called "racial bias education" training, spurred by outcry after a store manager in Philadelphia called police on two African American customers just minutes after they arrived for a meeting. Now, the company is accused of creating a different sort of unwelcoming environment.

The way the six officers were treated in the July 4 incident was "completely unacceptable," Rossann Williams, Starbucks's executive vice president and president of U.S. retail, said Saturday in a statement posted to Twitter.

"What occurred in our store on July 4 is never the experience your officers or any customer should have, and at Starbucks, we are already taking the necessary steps to ensure this doesn't happen again in the future," Williams wrote.

According to the association, the officers were standing with their coffees before their shift when a barista told them their presence was making a customer feel unsafe. The barista - who knew one of the officers, a regular customer, by name - requested that they "move out of the customer's line of sight or to leave," the association said in a statement posted to Twitter on Friday.

"Disappointed, the officers did in fact leave," the group wrote, adding, "While the barista was polite, making such a request at all was offensive. Unfortunately, such treatment has become all too common in 2019."

The Tempe Police Department officers had congregated around the spot where coffee is handed out, Starbucks spokesman Reggie Borges told The Washington Post on Sunday. Borges said he thought the barista believed the officers could just reposition.

Borges added that "the barista attempted to make the best of a challenging situation," saying the customer approached the barista multiple times with anxiousness about the police presence. Borges said the barista responded that the officers were regular customers and that the police were not here because they had been called.

Borges declined to provide additional information about any actions Starbucks may be taking against the employee. He said Starbucks does not have details to share on the customer who expressed discomfort with the officers' presence.

As the incident drew national attention, Williams spoke with Tempe police chief Sylvia Moir over the phone Saturday and flew to the city that night in the hope of meeting the chief in the following days, Borges said.

The spokesman said the conversation focused on deepening what he called an already-strong relationship between police and Starbucks stores in the area, but he declined to provide details.

Moir also expressed a desire to move past the incident, tweeting after reports of her discussions with Williams, "This is what reasonable, responsible people do."

"Twitter world - we are using this incident to show how to thoughtfully engage in dialogue - it is NOT ok to blame, rage, or call for anything other than positive change," Moir wrote in an earlier tweet, sharing Starbucks's apologetic statement. "@TempePolice & @Starbucks are professionals!"

The Tempe Officers Association had taken a more combative stance on Friday, tweeting a graphic in the style of the company's logo with the words "DUMP STARBUCKS" and a hand pouring out a cup of coffee. The tweet, which ended with the hashtag "#ZeroRespect," said some of the officers who were asked to leave are veterans.

The officers quickly drew support online.

Others on social media and forums such as Reddit - some using the same #DumpStarbucks hashtag - took a different lesson, saying the story should prompt soul-searching about why a customer would react with alarm at the sight of law enforcement.

And some noted the Philadelphia incident, wondering about the response of those now outraged about the officers being asked to leave.

In a statement posted to Twitter on Friday, Tempe police said the department hopes the incident was "between one community member and a single employee, rather than an entire organization," adding that when it reached out to Starbucks, it was told the interaction was "not in line with Starbucks' values."

The department and the Tempe Officers Association did not immediately respond to a request for comment.

Borges told The Post that Starbucks has worked hard to educate staff since grappling with accusations of racism after the incident in Philadelphia last year. In May 2018, the chain closed its outlets for a day of training for all employees on how to make the stores "a more welcoming place," Borges said.

Tensions with community members are not new to the Tempe police force, which in January joined a growing group of police departments nationwide facing backlash over officer shootings. A Tempe officer's fatal shooting of a 14-year-old boy with a replica airsoft handgun - captured on the officer's body camera - sparked rallies and calls for accountability from activists and relatives of the teen.

The officer involved shot the boy after responding to a report of someone "taking stuff" from a backyard, The Post reported. The officer shot the boy as he ran away, saying later, "He's got a handgun." The teen died at a hospital.

Public distrust of police has heightened elsewhere in Arizona, too, peaking in Phoenix after a viral video showed officers threatening to shoot a pregnant woman who was with her children and fiance. The officers were responding to a complaint about shoplifting, but the family was never charged.

Phoenix had the most officer-involved shootings of any city in the country last year, even though - at 1.6 million residents - it's far smaller than cities like New York and Los Angeles. A study last month also reported finding racist, misogynistic and violent posts on the Facebook pages of 97 current or former Phoenix police officers.