What is the history of calling police officers "pigs"?

by U-N-C-L-E

In a recent /r/AskEurope thread about nicknames of police, I learned that many countries refer to their police derisively as "pigs." How did this get started? Is it related to the insult "fascist pigs"? Or overweight officers? Do we know if it started in the U.S., Europe, or somewhere else?

freshthrowaway1138

Could I also ask why the British use the term "Filth" for their police?