A cache of texts from officers at the San Francisco Police Department has exposed rampant homophobia and racism.

The San Francisco Police Department is under investigation following complaints that officers had regularly used racial slurs – and investigations have found a shocking level of bigotry across severla groups of officers.

The SF Public Defenders office this week released a series of text messages exchanged by three police officers in 2014 and 2015 – which show a number of homophobic messages as well as racist ones.

Officer Jason Lai sent messages joking about “fags”, mocking a “tranny [who] stole from Safeway” in another.

He also repeatedly sent racist messages, using the N-word and referring to black people as “like a pack of animals on the loose.”

Lai added: ““Do you know what Obama coffee is? Black and weak!”

The investigation could devastate a number of SFPD cases if the officers are found to be prejudiced – with a potential impact on more than 200 criminal cases, including three murders.

However, Lai’s attorney insists “there is no evidence he carried out any of those sentiments as an officer.”

District Attorney George Gascon previously said the investigation covered more than 25,000 pages of text messages.

It is only the latest in a string of similar scandals at the SFPD – with no action possible against a number of San Francisco police officers who exchanged deeply disturbing racist and homophobic text messages in 2012.

The texts were uncovered during a federal corruption in 2014 – with officers making a string of homophobic comments about “f*gs”. The officers also referred to African-American people as “monkeys” and encouraged people to kill “half-breeds”.

However the statute of limitations on the allegations lasts just one year – meaning no action could be taken.