Hundreds of police officers and civilian staff have been investigated for homophobic, racist and threatening messages on social media, research shows.

Freedom of Information requests by the Press Association found bad behaviour engulfing forces right across the country.

More than 70 police staff have retired, resigned or been sacked over the past five years in some of the most serious breaches that have come to light.

Of 828 cases in England and Wales from 2009 to February this year, 9% ended in resignation, dismissal or retirement.

Forces said there had been inquiries into comments that were deemed homophobic, racist or “religiously aggressive”.

About a seventh (14%) of the cases reported resulted in no further action at all. The majority of other cases were dealt with through advice being offered to the officer in question.

Greater Manchester Police reported the most investigations, with 88 over the period. West Midlands was second highest with 74, while the Metropolitan Police recorded 69.

Chief Constable Alex Marshall, the head of the College of Policing which drew up a code of conduct for all officers, said: “Where people working in policing have undermined their own reputation or that of the wider service, they must face appropriate action. There is no place in policing for officers who abuse the trust placed in us by the public.”

The guidance also warned officers against posting messages after drinking alcohol, listing social events they were due to attend, or putting up personal details that could result in them being harassed or blackmailed by criminals.

Forces are increasingly making use of social media for witness appeals and officers have been encouraged to post pictures and stories of life on the beat.

But the rise of social media has raised concern that police are spending too much time policing abusive comments on platforms such as Twitter

A report published in January branded Greater Manchester Police “still an institutionally racist, sexist, homophobic and disablist organisation”.

The force pledged to do more in tackling bigotry among its ranks.