A coffee shop has banned police officers dressed in uniform in an effort to prevent their customers from becoming upset by their presence.

The ban began when Hasta Muerte in Oakland, California, denied a police officer’s request to buy a drink last month over fears for the “emotional safety” of other customers.

And the coffee shop stands by their decision according to a photo uploaded to the store’s Instagram page.

The post reads: “Last Friday, February 16, a police (OPD) entered our shop and was told by one of our worker-owners that ‘we have a policy of asking police to leave for the physical and emotional safety of our customers and ourselves.’

“Since then, cop supporters are trying to publicly shame us online with low reviews because this particular police visitor was Latino.

“He broadcasted to his network that he was ‘refused service’ at a local business.”

The coffee shop continued the post, defending the decision.

“We know in our experience working on campaigns against police brutality that we are not alone in saying that police presence compromises our feeling of physical and emotional safety,” they wrote.

The post then calls on the community to unite in keeping the neighbourhood, “an area faced by drug sales and abuse, homelessness, and toxic masculinity,” safe.

Despite the backlash for their decision, including a letter sent to the cafe by the Oakland police union, a ban on police officers is not illegal.

David Sklansky, a Stanford University law professor and co-director of Stanford’s Criminal Justice Centre, told Vice: “It's not against the law to refuse to serve police officers or any other kind of occupational category. It's like saying, 'Bus drivers are not welcome here,' or, ‘Trash collectors are not welcome.' It's a dumb and insulting thing to do to any group of workers, but it's not illegal.”

Since opening their doors last November, Hasta Muerte, which means “until death” in Spanish, has functioned as a nurturing and inclusive space for people in the neighbourhood - as well as an outspoken advocate for victims of police brutality, according to their website.

Owned and run by people of colour, the shop, which commemorates victims of police brutality on the walls outside, is about a mile from where a police officer fatally shot Oscar Grant, an unarmed black man, in 2009.

The shop's walls commemorate victims of police brutality (Fox 2)

On the coffee shop’s Instagram, a thank you letter from a customer, which reads: “Thank you for providing a space for the people. The ones with melanin who face oppression, who need a space to work, relax and feel at home. You are life, you are love,” is proudly featured.

However, not everyone is happy with the coffee shop’s decision.

The police officer who was denied entry said he was “surprised” and is “looking forward to talking with the owners of the coffee shop and the community.”

And on Yelp, the coffee shop is currently being monitored for reviews related to the police ban, as people have reacted strongly to the news.

Prior to the Yelp hold, one reviewer criticised the coffee shop, stating it feels more like “an Antifa stronghold.”