The San Francisco Police Department is investigating four of its own after dozens of racist and homophobic text messages sent between officers were disclosed in federal court documents Friday.

The texts were released in a motion filed by the U.S. attorney’s office to deny bail to former Sgt. Ian Furminger and detail “virulent” racism and homophobia, according to prosecutors. The texts implicate Furminger and four unnamed San Francisco police officers, according to court documents.

Furminger, 48, spent nearly two decades as a cop, most notably as a plainclothes officer working out of Mission Station before being convicted of corruption charges in February. He was sentenced to more than 40 months in prison.

After his conviction, Furminger told reporters that he had done nothing wrong and that his only regret was in not testifying during his trial. He is scheduled to report to prison April 3, but is seeking bail while he appeals the convictions.

The texts — sent between October 2011 and June 2012 among Furminger, other officers and civilians — offer a window into the personal life of a cop who was corrupt in both conduct and character, prosecutors said.

“Furminger actively promotes the fantasy that he is a person of character, pointing to awards that he has received as a police officer,” prosecutors wrote. “In doing so, he simply disregards the conduct for which he was convicted. ... He also fails to advise the court that he is a virulent racist and homophobe.”

On Nov. 9, 2011, a civilian texted Furminger, “Do you celebrate quanza (sic) at your school?”

“Yeah we burn the cross on the field! Then we celebrate Whitemas,” he responded.

On May 10, 2012, Furminger wrote to another officer, according to the documents, “I hate to tell you this but my wife friend (sic) is over with their kids and her husband is black! If (sic) is an attorney but should I be worried?”

The officer wrote back: “Get ur pocket gun. Keep it available in case the monkey returns to his roots. Its (sic) not against the law to put an animal down.” To which Furminger responded, “Well said!” according to the filing, brought to light in a story posted by KQED News.

The dozens of texts contain repeated uses of racial and homophobic epithets.

In response to a text about a black officer getting a promotion, Furminger wrote, “F— n—.” He also repeatedly calls another officer a “fag,” according to the documents.

The bigoted views expressed in the texts were disgraceful, especially in San Francisco, thought to be a bastion of progressive ideals, prosecutors said.

“Although these sort of overtly racist views sadly still are expressed in some communities,” they wrote, “it is shocking and appalling to find a police officer in San Francisco who would give voice to them.”

Officer Albie Esparza, a spokesman for the Police Department, said the four officers in question had been reassigned “some time ago” during the internal affairs investigation into the texts, which is ongoing.

“The SFPD is investigating officers for extreme bias, which has no place in the Police Department,” he said. “Any investigation that reveals that an officer is biased will be forwarded to the Police Commission with a recommendation from the chief for termination.”

Kale Williams is a San Francisco Chronicle staff writer. E-mail: kwilliams@sfchronicle.com Twitter: @sfkale