A spree criminal from North Carolina was arrested in Brooklyn on Tuesday after he stole a car here, just days after getting released from jail, raping a teenage girl, killing a man, and carjacking his way up to New York, police said.

Kendrick Gregory, 21, was tracked down after he stole his fourth car in two days, said Chief of Patrol Carlos Gomez, speaking at a news conference at police headquarters Wednesday.

"He was a one-man crime spree," Gomez said. "These officers took him off the streets and surely prevented similar acts here in our city."

The spree started when Gregory, from Raleigh, allegedly carjacked someone at gunpoint in North Carolina on Sunday. Later that night, at about 9:30 p.m., he stole another car, a BMW, at gunpoint, Gomez said.

The next day, Gregory apparently robbed and shot a man, who survived. Hours later, at about 7 p.m. on Monday night, Gregory fatally shot a man while robbing a pawnshop.

About 30 minutes after that, he raped a 15-year-old girl at gunpoint, Gomez said, and then waited another two hours before robbing a grocery store and shooting at the employee, but missing.

At about 11:15 p.m. on Monday he stole a Toyota Corolla, which he used to drive up to New York, authorities said.

"God knows what he would have done up here in New York," said Police Commissioner Bill Bratton, commending the NYPD officers who stopped him. "He was literally an individual totally out of control."

On Tuesday, Gregory allegedly grabbed a 55-year-old woman's car as she was getting money at a ATM at about 3:30 p.m. by Warren Street and Broadway.

A trio of officers from Manhattan's 1st Precinct, Andrew Vlasaty, Erik Skoglund, and Adam Riddick, downloaded an app on their phone to find the car, which had a tracking system installed in it. They then gave chase.

When Gregory was finally arrested, Gomez said they found a loaded .45 caliber automatic pistol inside his pants pocket, and another .45 caliber pistol under the driver's seat. At least one of those pistols was stolen from the pawnshop robbery, said Chief of Detectives Robert Boyce.

"It's flabbergasting," said Riddick, thinking about the spree he and his team stopped. "Even we didn't really expect that much. It mushroomed very quickly. We were very happy that we were part of that and we were able to work as a team to stop him."

For Riddick, who said he used to work as a specialist at Apple doing tech repair, downloading an app to try to find the stolen car was a no brainer.

The officers did not know Kendrick was armed when they went after him.

"It was iffy," said Skoglund, who has been with the department for more than three years. "We kind of went at it hard so I think that helped him to surrender."

Gregory was released from jail on Aug.26. Authorities believe he had ties to Brooklyn, but it was not immediately clear what those were.

He had one prior arrest in Manhattan in 2014 when he was living at a homeless shelter here, Boyce said.