A New York City police horse tossed an officer to the pavement and took off down a busy Midtown street on Wednesday after being spooked by a loud noise, the authorities said.

The police said a sergeant was riding the horse, named Gunny, on 48th Street between Sixth and Seventh Avenues around 7:25 p.m. when the animal was frightened by a sudden sound from a truck that was being unloaded nearby.

The officer, still connected to the horse through his stirrup, was dragged on the ground before managing to get himself loose, the police said. He was taken to a hospital with injuries that were not life-threatening, they added.

The horse ran free as some onlookers took to social media to share their reactions.

“There’s an escaped police horse running against traffic in Times Square,” a comedy writer, Mike Scollins, wrote on Twitter, calling it “insane.”