A quick-thinking New York Police Department officer who shot a terror suspect in Manhattan after a truck was used in a deadly killing spree has been hailed a hero for bringing it to an end.

The city police officer, Ryan Nash, was responding to a report of a suicidal teenager at a high school in lower Manhattan when he heard reports that a vehicle had hit people nearby.

Officer Nash confronted Sayfullo Saipov after a rented truck was driven down a bike lane and into a school bus, killing eight and injuring 11, including children, the New York Daily News reported.

The officer shot the 29-year-old suspect and wounded him when he refused to drop a pair of realistic-looking weapons, later identified as paintball and pellet guns.

Speaking at a press conference afterwards, NYPD commissioner James O’Neill said: “I want to commend the response of our NYPD officer that was on post near the location who stopped the carnage moments after it began.”

The 28-year-old officer was called to Stuyvesant High School to reports of a suicidal 17-year-old girl at 2.35pm.

Around 30 minutes later the truck hit cyclists and pedestrians on Chambers Street, near the school.

Officer Nash rushed to the scene where he saw Saipov brandishing the guns.

New York Truck attack Show all 6 1 /6 New York Truck attack New York Truck attack Investigators inspect the truck following the attack Investigators inspect a truck following a shooting incident in New York on 31 October 2017. Several people were killed and numerous others injured in New York on Tuesday when a suspect plowed a vehicle into a bike and pedestrian path in Lower Manhattan, and struck another vehicle on Halloween, police said. A suspect exited the vehicle holding up fake guns, before being shot by police and taken into custody, officers said. The motive was not immediately apparent. Getty New York Truck attack A paramedic looks at a body along the bike path A paramedic looks at a body covered under a white sheet along the bike path 31 October 2017, in New York. A motorist drove onto a busy bicycle path near the World Trade Center memorial and struck several people Tuesday, police and witnesses said. AP Photo/Bebeto Matthews New York Truck attack The truck driver collided with a school bus Authorities respond near a damaged school bus Tuesday, 31 October 2017, in New York. A motorist drove onto a busy bicycle path near the World Trade Center memorial and struck several people, police and witnesses said. Two adults and two children were on the bus at the time. AP Photo/Bebeto Matthews New York Truck attack A young girl reacts to the scene A young girl reacts as police officers secure an area following a shooting incident in New York on 31 October 2017. Several people were killed and numerous others injured in New York on Tuesday after a vehicle plowed into a pedestrian and bike path in Lower Manhattan, police said. 'The vehicle struck multiple people on the path,' police tweeted. 'The vehicle continued south striking another vehicle. The suspect exited the vehicle displaying imitation firearms & was shot by NYPD.' DON EMMERT/AFP/Getty Images New York Truck attack Police officers arrive at the scene Police officers arrive at the scene following a shooting incident in New York on 31 October 2017. Multiple people were hurt in downtown Manhattan, US media reported after police confirmed that they were responding to reports of a shooting. Police said they had mobilized to the scene in Lower Manhattan and that one person was in custody, giving no further details. DON EMMERT/AFP/Getty Images New York Truck attack Emergency personnel respond to truck attack in lower Manhattan Emergency personal respond after reports of multiple people hit by a truck after it plowed through a bike path in lower Manhattan on 31 October 2017 in New York City. According to reports up to six people may have been killed. Kena Betancur/Getty Images

Police said Saipov didn’t obey orders to drop the weapons and Nash opened fire, hitting him in the abdomen.

Nash joined the NYPD in July 2012.