Philadelphia’s top cop defended the actions of his officers on Saturday after a viral video showed two black men being arrested for refusing to leave a Starbucks when a store employee denied them access to the restroom.

In a video posted on Facebook, Philadelphia Police Department Commissioner Richard Ross said officers received a trespassing call from Starbucks after the men allegedly used the restroom without making a purchase, which goes against company policy.

The men were asked by officers to leave, but refused and subsequently detained, Ross said in the video.

“The police did not just happen upon this event, they did not just walk into Starbucks to get a coffee,” he said. “They were called there, for a service, and that service had to do with quelling a disturbance, a disturbance that had to do with trespassing."

Ross said the officers "followed policy" and did what they were supposed to do.

"These officers did absolutely nothing wrong," he said.

Ross, who is black, said the department makes sure that officers receive "implicit bias training."

"I will say, that as an African-American male, I am very aware of implicit bias," Ross says in the Facebook video. "We are committed to fair and unbiased policing and anything less than that will not be tolerated in this department."

The city's top cop added that there was a case involving a Philadelphia officer who went to Starbucks who was also denied access to the restroom, even though he was in full uniform.

"They are at least consistent in their policy," Ross said.

In the viral video of the incident, which was posted to Twitter and has nearly 9 million views as of Sunday afternoon, at least six officers put the men in handcuffs and take them into custody without resistance.

STARBUCKS ISSUES APOLOGY OVER ARREST OF TWO MEN

The CEO of Starbucks, Kevin Johnson, said in a statement on Saturday he wants to personally apologize to the men, adding that the company "stands firmly against discrimination or racial profiling."

Johnson's statement didn't address exactly what led to the police call, but a Starbucks spokeswoman said the store where the arrests occurred has a policy that restrooms were for paying customers only. In the video, no Starbucks items are visible in front of either of the men.

Johnson said the company's practices and training led to a "bad outcome," and the reason for the call that brought police into the shop was incorrect.

"Our store manager never intended for these men to be arrested and this should never have escalated as it did," said the statement. Johnson said videos of the arrest were "very hard to watch," and the company was investigating.

"We also will further train our partners to better know when police assistance is warranted," said Johnson. "Additionally, we will host a company-wide meeting next week to share our learnings, discuss some immediate next steps and underscore our long-standing commitment to treating one another with respect and dignity."

The incident has sparked outrage online, and drew the response from Philadelphia native and comedian Kevin Hart.

"Message to the @Starbucks in Philadelphia....Our city is shining bright like a diamond right now. Please make this situation right. I repeat please make this situation right!!!!!!! Once again MAKE THIS RIGHT," he tweeted Sunday.

Hart also questioned why the men were arrested in the first place.

"@Starbucks in Philadelphia I have watched the video and do not see these to young men doing anything wrong....Unless there is footage that shows otherwise you need to do what's right and handle the manager that was on duty accordingly," Hart said.

Tennis icon Billie Jean King, whose organization, the Billie Jean King’s Leadership Initiative, recently partnered with Starbucks to support "global gender pay equity," called the incident "deeply troubling."

"The arrest of 2 African-American men in a Philadelphia @Starbucks is deeply troubling," she said on Twitter. "This event is not representative of how Starbucks operates. Kevin Johnson’s apology & actions are a good 1st step. An investigation will follow, and we should give them the time to do it."

Protesters gathered outside the Starbucks in question Sunday in solidarity with the two men arrested, according to FOX29.

Fox News’ Paulina Dedaj contributed to this report.