NEW YORK -- Two New York City police officers were sitting in a patrol car parked in the heart of Times Square when a man approached Wednesday night and threw what looked like a bomb from his SUV into their car.

It was 11:30 p.m. and Times Square was still teeming with theatergoers, restaurant patrons and the usual throngs of tourists.

The device landed with a thud on the squad car's dashboard and the man fled in his SUV. Sgt. Hameed Armani and Officer Peter Cybulski stared briefly at the tin-foil-wrapped object and began driving their car, with the object still inside, away from the crowds.

"We knew what each other was thinking. We weren't going to let anything happen in Times Square," Cybulski said at a Thursday morning press conference.

Get Breaking News Delivered to Your Inbox

"We both said our prayers," Armani said. "We thought, 'This is it, you know, we're not gonna make it.' But I'm happy I'm not gonna -- no one is gonna get hurt."

The device was later deemed to be a hoax -- a red candle with two LED-style lights, wrapped in foil and white cloth -- but New York Police Commissioner William Bratton said Armani and Cybulski showed they were willing to risk their own lives to save others.

"These two officers are heroes of the NYPD, heroes of New York City," Bratton said.

The contents of what New York City police say was a fake bomb that was thrown into a patrol car in Times Square on Wednesday, July 20, 2016. New York Police Department

The man in the SUV, believed by police to be Hector Meneses, 52, was spotted early Thursday morning not far away, at Manhattan's Columbus Circle, where he was quickly surrounded.

Chief of Manhattan Detectives Bill Aubry said Meneses declared that he wanted to die and that he had a bomb, according to CBS New York.

"He puts on a red, EMS-type helmet, it's like a construction helmet, on his head and he continues to display erratic behavior in that 'I have a bomb strapped to me, I want to die,'" Aubry said.

Video of the inside of the SUV showed what appeared to be a device. After an hours-long standoff and a bomb squad evaluation, police decided to extricate the suspect.

Meneses was taken into custody shortly before 8 a.m. Thursday. He faces eight charges, including reckless endangerment, placing a false bomb and making a terroristic threat.