An NYPD officer working overnight following the Independence Day holiday was assassinated in an unprovoked attack in the Bronx, department officials said Wednesday.