James O’Neill, leader of New York City's police force, announced Monday that he's stepping down as commissioner, saying it was time for him and the NYPD "to move forward."

O'Neill, who will be on the job for another month, has been head of the nation's largest municipal police force since September 2016, when he succeeded Bill Bratton.

Mayor Bill de Blasio named NYPD Chief of Detectives Dermot Shea as the new commissioner.

Dermot Shea, New York Police Department chief of detectives, speaks at a crime scene in Brooklyn on Oct. 12, 2019. Johannes Eisele / AFP - Getty Images

O'Neill, 61, recently drew harsh criticism from the union representing officers after he fired Daniel Pantaleo, the New York City Police Department officer accused of using a banned chokehold that led to Eric Garner's death in 2014.

Patrick J. Lynch, president of the city's Patrolmen's Benevolent Association, said O'Neill lost the confidence of officers on the beat by firing Pantaleo, who is suing to get his job back.

O'Neill on Monday stopped short of saying the Pantaleo case was the tipping point for his departure.

"It wasn’t a motivating factor in my decision. I'm not going to stand up here and say it didn't weigh on me heavily," O'Neill told reporters. "I think it weighed on all New Yorkers. It weighed on everybody in the NYPD."

The soon-to-be-former commissioner said the timing was right for his departure.

"This is the right time for me and it's time I have to move forward," he said. "The NYPD has to move forward."

De Blasio said O'Neill was taking a new job in the private sector, but New York's top cop declined to reveal what that would be.

"I'm leaving because I have another opportunity," O'Neill said, "it's something that I couldn't pass up."

Ed Mullins, president of the Sergeants Benevolent Association, had harsh words for O'Neill as he exited.

"This announcement is long overdue," Mullins said in a prepared statement. "Like any coward, Commissioner O'Neill chose to run off before the entire empire fell."

De Blasio called O'Neill "the architect of neighborhood policing" and credited him with bringing New York crime rates to record lows while bridging police-community relations.

"For 35 years, Jimmy O'Neill has served this city with distinction, with dignity, with decency, with his whole heart," de Blasio said.

The mayor said he has full confidence in Shea.

"The fact is that Dermot is one the best prepared incoming police commissioners this city has ever seen," de Blasio said.

O'Neill, a native of Brooklyn's Flatbush neighborhood, is the NYPD's 43rd commissioner. Prior to leading the department of 36,000 officers and 19,000 civilian employees, he served as chief of department, the highest uniformed rank.

His law enforcement career began in 1983 when he joined the New York City Transit Police, which at the time was a separate agency from the NYPD. The transit force and the NYPD merged in 1995 and O'Neill steadily moved up the ranks, eventually being promoted to executive officer in the 52nd Precinct in the Bronx.

He also served as commanding officer of the Central Park Precinct and the 44th Precinct in the western Bronx. When terrorists attacked the World Trade Center on Sept. 11, 2001, O'Neill was commanding officer of the 25th Precinct in East Harlem.

Shea, 50, credited his predecessor as a key mentor.

"We would have to go on probably for an hour to recount all that I've learned from Jim, but I'll stress one — humanity," Shea said.

The next commissioner fondly recalled his first days on the job, as a beat cop in the 46th precinct of the South Bronx.

"There was some wet days, there was some cold days, there were some hot days, but there was nothing better than walking out and just talking to people as you would interact with them day in and day out," Shea recalled.

"It struck me immediately how much you need it, how much you relied on it in some of these neighborhoods."

Shea, the son of Irish immigrants who came to Sunnyside, Queens, in the 1950s, comes from a law enforcement family. His brother, James Shea, is now director of public safety in Jersey City.

The incoming commissioner said he hasn't yet shared news of this promotion with his younger brother Paul, who was in law school when he enlisted in the U.S. Army after 9/11.

"You see somewhere in the DNA there must be service," Shea said.