Amid outcry over the arrest of two black men in a Philadelphia Starbucks, the coffee chain announced Tuesday that it will close more than 8,000 U.S. stores for an afternoon next month to train workers in "racial-bias education."

The stores will be shuttered on the afternoon of May 29, the company said in a press release, and its corporate offices will also be closed at that time. And nearly 175,000 employees will undergo the training.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"I've spent the last few days in Philadelphia with my leadership team listening to the community, learning what we did wrong and the steps we need to take to fix it," Starbucks CEO Kevin Johnson said in a statement. "While this is not limited to Starbucks, we're committed to being a part of the solution."

The stakes have been high for the coffee giant, and brand reputation experts said the company had a narrow window of time to tamp down public outrage.

"Closing our stores for racial bias training is just one step in a journey that requires dedication from every level of our company and partnerships in our local communities," Johnson said.

The two men, whose identities have not been released, were arrested last Thursday after a Starbucks manager called 911. They had been sitting in the store without buying anything and refused to leave, according to police.

Johnson met privately on Monday with the two men, a spokesperson for the coffee giant confirmed to NBC News. He has apologized to the men and promised changes at the company.

Protesters demonstrate inside a Center City Starbucks in Philadelphia on Monday. Mark Makela / Reuters

The store manager who called police is "no longer at the store," a Starbucks spokesman said Monday. It was not immediately clear whether the manager had been fired.

Philadelphia Police Commissioner Richard Ross said Saturday that the men had not purchased anything and refused to leave, which led to the arrest. The men were eventually let go after about eight hours in police custody, and Starbucks did not press any charges.

Michelle Saahene, who said she witnessed the incident, told NBC News on Sunday that the men were not permitted to use the bathroom because they had not purchased anything. They then sat at a table while using their phones as they waited for a friend, Saahene said.