Mayor Eric Adams, Police Commissioner Keechant Sewell and a crowd of his fellow officers applauded and cheered the officer as he walked out of the hospital on Sunday afternoon.
Sewell had said at a press conference on Saturday that the officer awoke around 6:15 a.m. when a bullet was fired through one of the car's windows, hitting him in the head.
The officer got out of his vehicle and was aided by a sergeant who saw blood coming from his head, Sewell said.
She said the officer was rushed to the hospital, where he was treated for a fractured skull as bullet fragments were removed from his wound.
The officer is expected to make a full recovery.
"We are grateful that our officer is recovering as we know this could have been a very tragic outcome," Sewell said in a press conference Saturday afternoon.
Police are still investigating who fired the bullet and if the officer was the intended target. Sewell said that there were no other 911 calls for gunfire in the area at the time of the shooting, and no other officers heard anything.
Mayor Eric Adams, who joined a news conference outside the hospital, said a hunt was underway for the person who fired the shot.
Adams, who was sworn in earlier Saturday, said he wanted to send a message that "this is not going to be a city of violence."
Police said the bullet appeared to be deflected by the rear passenger window it appeared to go through or perhaps by the officer's skull.
Sewell said the officer had worked a full shift Friday in Central Park and was resting before starting another shift at 7:30 a.m. Saturday.
She said she "could not be more pleased that he is recovering."