Philadelphia: Philadelphia's police commissioner on Saturday defended the arrest of two black men as they sat in a Starbucks coffee shop, and said his officers had to act after Starbucks employees told them the pair were trespassing.

Video of Thursday's incident, which was taken by an onlooker and shared widely online, showed other patrons telling officers that the pair were doing nothing wrong and appeared to be targeted merely for their race.

Melissa DePino, an author who posted a video of the arrest, said staff at the Starbucks called police because the two men had not ordered anything while waiting for a friend. She said white customers were "wondering why it's never happened to us when we do the same thing."

@Starbucks The police were called because these men hadn’t ordered anything. They were waiting for a friend to show up, who did as they were taken out in handcuffs for doing nothing. All the other white ppl are wondering why it’s never happened to us when we do the same thing. pic.twitter.com/0U4Pzs55Ci — Melissa DePino (@missydepino) April 12, 2018

Police Commissioner Richard Ross said he knew the incident had prompted a lot of concern but said his officers "did absolutely nothing wrong."

In a video statement, Ross said employees at the store called 911 to report a disturbance and trespassing.

When officers arrived, Ross said, staff told them the two men had wanted to use the restroom but were informed it was only for paying customers. The pair repeatedly refused to leave when asked politely by the employees and officers, he said.

"If you think about it logically, that if a business calls and they say that someone is here that I no longer wish to be in my business, they (the officers) now have a legal obligation to carry out their duties. And they did just that," Ross said.

"They were professional in all their dealings with these gentlemen, and instead they got the opposite back."

Ross said that as an African-American man he was acutely aware of implicit bias. "We are committed to fair and unbiased policing and anything less than that will not be tolerated in this department," he said.

The two men were released, Ross said, after officers learned Starbucks was "no longer interested" in prosecuting them.

In a post on Twitter earlier on Saturday, Starbucks Corp said it was sorry for what took place.

"We apologise to the two individuals and our customers and are disappointed this led to an arrest. We take these matters seriously and clearly have more work to do when it comes to how we can handle incidents in our stores," Starbucks said.

We regret that our practices and training led to the reprehensible outcome at our Philadelphia store. We’re taking immediate action to learn from this and be better. A statement from ceo Kevin Johnson: https://t.co/kPav8bEeOX — Starbucks Coffee (@Starbucks) April 15, 2018

"We are reviewing our policies and will continue to engage with the community and the police department to try to ensure these types of situations never happen in any of our stores."

Police departments across the United States have come under criticism for repeated instances of killing unarmed black men in recent years, which activists blame on racial biases in the criminal justice system.