KEY WEST, Fla. — The Miami-Dade state attorney’s office is combing through more than 150 criminal cases of black suspects arrested by Miami Beach police officers who wrote or received racist emails, the latest in a series of high-profile episodes around the nation that have raised troubling questions about the relations between the police and the communities they serve.

Two ranking officers at the Miami Beach Police Department sent about 230 emails that contained racist and sexist jokes and pornography from 2010-12, Chief Dan Oates announced Thursday. A former police captain, who had been demoted to lieutenant, was fired, and a major retired before the investigation was made public.

Fourteen other officers received the emails, the police department said.

The episode, which follows the release of racist or homophobic emails in Ferguson, Mo.; San Francisco; and Fort Lauderdale, adds another level of discord to the often-strained relations between the police and minority groups. Officers in Edison, N.J.; Seattle; Baton Rouge, La.; and Casselberry, Fla., have also been fired or disciplined over racist text and email messages, a wave that some experts believe indicates a culture in which officers are comfortable expressing racist views.

The episodes also raise questions about whether an officer’s flippant attitude about race manifests itself on the streets.