PHILADELPHIA — Philadelphia’s police commissioner Saturday defended officers who arrested two black men at a Starbucks, prompting accusations of racism on social media and an apology from the company.

Videos posted online show officers handcuffing the men in the downtown establishment Thursday. A white man in the video is heard saying he was meeting with the men and calls the arrests “ridiculous.”

Commissioner Richard Ross said Starbucks employees called 911 to say the men were trespassing. He said officers were told that the men had come in and asked to use the restroom but were denied because they hadn’t bought anything, as he said is company policy. He said they then refused to leave.

Ross, who is black, said police asked the men to leave three times but they refused, and they were then arrested but were later released after the company elected not to prosecute. He said the officers “did absolutely nothing wrong” and were professional in their conduct toward the individuals but “got the opposite back.” He did not mention the person who said he was meeting with the men.

“As an African-American male, I am very aware of implicit bias; we are committed to fair and unbiased policing,” Ross said. But he added: “If a business calls and they say that ‘Someone is here that I no longer wish to be in my business’ (officers) now have a legal obligation to carry out their duties and they did just that.”

Starbucks posted an apology on Twitter Saturday, saying the company was “disappointed this led to an arrest” and was reviewing its policies.