An ex-naval officer speeding the wrong way up a Seventh Avenue sidewalk mowed down nearly two dozen pedestrians in the heart of Times Square, killing one person and injuring 22 others, officials said.

Richard Rojas, a Bronx native with two prior DWIs, started the carnage at Seventh Avenue and 42nd Street, where he made a “quick U-turn” and mounted the sidewalk, said NYPD Assistant Chief William Aubry.

He then sped north for 3½ blocks, killing 18-year-old Alyssa Elsman and injuring 22 others, before his 2009 Honda Accord struck a pole near 45th Street and Broadway, officials said.

“[He] proceeded to drive at a high rate of speed along the sidewalk from 42nd to 45th Street, striking a large number of pedestrians along the way,” NYPD Chief of Police James O’Neill said at a press conference Thursday afternoon.

A traffic agent stationed in the area tackled Rojas when he got out of his car, as other patrol cops and civilians jumped in to help apprehend him, Aubry added. Witnesses said he punched a police officer at one point.

Rojas was put in a patrol car and taken to the Midtown South Precinct, where he made “certain statements” to police officers, officials said. He’s being tested for drugs and alcohol.

Photos taken in the wake of the carnage show pedestrians lying in the street, and the young woman covered with a bloodstained blanket on the sidewalk.

“just witnessed a car running people over in times square. scariest moment of my life. what is wrong with some people?!” wrote Twitter user Michael Rickerby.

Four people were taken to area hospitals in critical condition, with open fractures and “multiple traumas,” but are expected to live, officials said.

“None of those four are likely to perish. We’re very hopeful … that they will survive,” said FDNY Commissioner Daniel Nigro.

Three other injuries are considered “very serious” but not critical.

Rojas, who’s been arrested several times, is a US citizen and former member of the US Navy, Mayor Bill de Blasio said.

“[There is] no indication this was an act of terrorism,” Hizzoner added.

“We all feel deeply right now for those who are injured and for their families, and particularly for the family of the young woman who was lost.”

Rojas was arrested May 11 in the Bronx for threatening someone who came to his house to get an annuity notarized. Rojas accused the person of stealing his ID, then put a knife to his throat, police sources said.

He was charged with menacing and criminal possession of a weapon, but pleaded guilty to harassment.

Rojas also was charged with DWI in 2008 and 2015, according to sources.