Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Florida police department is mired in criticism after an officer was seen on surveillance video throwing peanuts at a homeless man.

The tape shows Officer Andrew Halpin tossing peanuts while booking Randy Miller at the Sarasota County Jail on July 18. Miller is seated and handcuffed, and opens his mouth like a circus animal — apparently at Halpin's command.

Two officers watch in the background as the apparently intoxicated Miller tries to catch the peanuts.

The video was made public on Monday. Sarasota Police Chief Bernadette DiPino told NBC station WFLA she was not aware of the incident until the video was made public.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

“I’m disappointed in what I saw in this video,” DiPino said. “Due to the actions I’ve seen on camera, I immediately initiated an internal affairs investigation.”

Miller, 44, was arrested for trespassing at a convenience store, WFLA reported. He has an extensive rap sheet, the station said.

The American Civil Liberties Union of Florida called Halpin's treatment of Miller "humiliating" and is demanding that he be fired, according to WFLA.

The two-and a-half-minute long video was obtained by the Sarasota Herald-Tribune through a public records request.

Later in the video, Miller slumps to the floor and eats the peanuts off the floor, while Halpin kicks nuts toward him, the Herald-Tribune said.

Related: Fort Lauderdale Latest City to Restrict Feeding Homeless

Sarasota, which bans camping overnight without permission on public or private property, was ranked the "meanest city in the nation" toward homeless people in 2006 by the National Coalition for the Homeless.

More recently, other cities, including Fort Lauderdale, Florida, have imposed restrictions on offering meals to homeless people in public places. Fort Lauderdale passed at least four laws in 2014 concerning homeless people.