An off-duty NYPD officer resting between weekend shifts was shot while sleeping inside his car at a police precinct in East Harlem, police and city officials said Saturday.

The officer woke around 6:15 a.m. when a bullet broke through one of the car windows and struck the officer in the head, NYPD Commissioner Keechant Sewell said outside NewYork-Presbyterian Hospital that afternoon.

An on-duty sergeant found the officer after he exited the car, bleeding from a gunshot wound. The injured officer received aid and was rushed to the hospital where he underwent surgery. Doctors confirmed the officer suffered a fractured skull, NBC New York reports.

Sewell said the officer had concluded an 8-hour shift around 2:30 a.m. at Central Park, where he was covering a New Year's Eve event, before returning to the precinct. She said the officer chose to rest in his personal vehicle at the 25th Precinct before starting his next shift at 7 a.m.

Investigators are working to determine who fired the bullet and if the officer was the intended target.