NYPD commissioner William Bratton said Monday he doesn’t intend to stay into a possible second term for Mayor Bill DeBlasio and indicated he could leave before the end of 2017.

Speaking at a news briefing with de Blasio, Bratton reminded reporters that the issue of his leaving was first broached last July. The timing of his exit was resurrected Monday in an online story in The New York Times.

“I think well over a year ago that question was asked and I responded then, as I did in the most recent interview in the Times that I did not intend to stay into a second term,” Bratton said, adding that he was confident de Blasio would win a second term in 2017.

Minutes later de Blasio said Bratton had been doing an outstanding job and has “made clear he is not prepared to stay into a second term — I absolutely respect that — especially after all he has given the city over the years.”

Bratton’s remarks Monday about how long he will be stay as the city’s top cops were a shift from his comments in July 2015. Then, at the age of 67, Bratton said he didn’t intend on working beyond age 75 and “wouldn’t be commissioner for six and a half years” — a timetable that would stop his tenure short of the end of a potential de Blasio second term in 2022.

Bratton, 68, turns 69 in October.

“There is never a good time to leave something that you love doing but there is a right time,” Bratton said. “When I find that right time, that is when, with consultation with the mayor, I will decide to go. But fortunately I have his faith and confidence. I am not worried about getting kicked out of the place, fortunately.”

advertisement | advertise on newsday

Both Bratton and de Blasio chuckled when a young reporter asked if the commissioner had been disillusioned with criticism he has faced since his appointment in 2014.

“Criticism drives my wife crazy. To be quite frank it doesn’t bother me at all,” answered Bratton, whose spouse, television commentator Rikki Klieman, was in the audience. “I have been in the business 45 years — twice as long as probably you have been alive — and during that time have suffered a lot of slings and arrows . . . it comes with the territory.”

There was speculation that Bratton’s chief of department, James O’Neill might be Bratton’s replacement.

O’Neill didn’t comment on his future aspirations beyond stating his pride serving in the NYPD.

“The beauty of my job is it is apolitical,” O’Neill said. “I love being a cop. I love wearing this uniform.”