ST. PETERSBURG, Fla. -

A St. Petersburg police officer fatally shot a German shepherd while trying to detain a man at a park.

Police say 21-year-old Kenneth McNeal had been given a warning to stay out of Williams Park. He was walking the dog for a friend Thursday night and ignored an officer's demand to stop.

The Tampa Bay Times reports officers grabbed at McNeal, who let go of the leash. Once free, the dog tried to bite one of the officers.

An officer fired several shots, killing the dog.

McNeal was charged with trespassing and resisting arrest with violence.

The internal affairs division is investigating.

St. Petersburg police have come under scrutiny before for dog shootings. The Times reports officers killed at least seven dogs in 2011, prompting some policy changes.