Some top police officials have pointed to a retired chief who headed Ray Kelly’s security detail as the source of Kelly’s controversial comments that NYPD Commissioner Bill Bratton distorted shooting stats to make the city appear safer than it is.

Kelly, the former commissioner, has said his information was “supplied by active members of the department themselves,” but the officials say the chief, who now works in the private sector, “reached back” inside the department, as one of them put it, to contact officers for his information.

It is unclear whether the officials’ claim is correct, whether the officials are settling personal scores, or whether they’re so embittered toward Kelly that they would attack a chief because he was close to Kelly.

Because the NYPD officials would not speak on the record, NYPD Confidential chose not to identify the chief at this time. He returned a call to say: “I never made a phone call to anyone in the department. I never spoke to Ray Kelly [about statistics] . . . I have nothing but respect for Bill Bratton. All I want is for the department to succeed.”

Department spokesman Steve Davis said, “We are much more interested in whether former Commissioner Kelly has specific facts about shootings that he will share with us than in learning who might have told him that.”

Those who know the chief describe him as smart and personable and with relatives on the job. As head of Kelly’s security detail, the chief stopped the exodus of detectives assigned to protect Kelly who were leaving in droves.

The detail is considered a coveted NYPD assignment, with a lock on overtime and grade promotions, but 16 detectives and supervisors had left by 2005, Kelly’s third year as commissioner. The departures reflected the difficulties for subordinates who worked closely with Kelly.

The exodus began after Kelly dismissed longtime aide Sgt. Manny Lopez, who had served in the detail a decade before. In 2004, after the midnight shooting in Brooklyn of Timothy Stansbury, a black teen, by a white cop, Kelly blamed Lopez for not alerting him immediately and waiting until the next morning.

Kelly forced Lopez out of the detail and when Lopez filed for retirement, Kelly had him investigated for overtime abuse.

None was found.